davidfox 发表于 2003-11-11 12:22:33

clear源代码,有人能解释吗?

#include <linux/unistd.h>

int main(void)
{
       write("\033[1;1H\033[2J",10);

      return 0;
}

EdwardRF 发表于 2003-11-11 12:45:29

"\033[1;1H\033[2J" is called a escape secquence. as old terminals are connected through serial cable which can only transmit ASCII codes.
special controls such as clear screen is sent though a escape secquence.(a esc key(27) followed by secquence of ASCII code .

davidfox 发表于 2003-11-11 13:13:54

谢谢!!!!

Aroutine 发表于 2003-11-11 17:47:01

i can not read any of them,i think i must study hard and learn more!
页: [1]
查看完整版本: clear源代码,有人能解释吗?