News for hackers. Stuff that matters.
Re:Ask HN: Why doesn't 'clear' actually erase the console? by koolkat on Sunday February 08, 2015 @08:43PM (#9019360)
Yes. I think its a special code that the program sends to the terminal. It comes from the days terminals used to be fisical instead of virtual. Its in the termcap database that corresponds to the terminal you use.
Re:Ask HN: Why doesn't 'clear' actually erase the console? by franciscogarcia on Sunday February 08, 2015 @08:39PM (#9019345)
I always thought it just printed empty lines based on window height. So when you scrolled up, stuff was still there.
Re:Ask HN: Why doesn't 'clear' actually erase the console? by koolkat on Sunday February 08, 2015 @08:49PM (#9019381)
This code works on my terminal: \e[1;1H\e[2J So try printf "\e[1;1H\e[2J"