The reset
command includes a delay, between clearing the screen and returning. This is even on the latest terminal type xterm-256color
. Why?
man reset
does not mention a delay, only the printing of special strings. (It doesn't mention clearing the screen either. I assume this is included under the terminal initialization string).
I notice the follow output in strace -f reset
:
nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffe1964f100) = 0
ioctl(2, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
Best Answer
Real (hardware) terminals need that. For instance, with some, the only way to reset them is to do a hardware-reset.
It's harmless with a terminal emulator, and since there's no conventional way to tell the difference (and too hard to determine if some escape sequence might do a hardware-reset),
reset
assumes your terminal is real.The time-delay dates back to
tset
in 3BSD in 1979, like this:It's evolved somewhat in ncurses, but using the same guideline:
Further reading:
tset
manual page)tput
manual page)