Linux command reset (1) slow

The console command reset(1) , I think, is too slow. It takes 1 sec on my machine. Wall time to complete.

Why is this? Can this be done quickly? Also, is there another command that can delete my terminal buffer?

+7
source share
3 answers

I ran strace reset and saw this near the end:

 nanosleep({1, 0}, 0x7fffe32053e0) = 0 

Therefore, it intentionally waits a second after sending all terminal codes reset, possibly because some terminals take time to process everything.

You do not need to use reset often (only when the full-screen program is anonymously terminated, so that it does not reset the terminal itself), why is this a big deal?

I'm not sure what you mean by the word "erase my terminal buffer". This is not what reset for.

+5
source

reset calls tput (1) with the arguments clear, rmacs, rmm, rmul, rs1, rs2 and rs3. This causes tput to send the appropriate reset lines to the terminal based on information in / etc / termcap (for GNU or BSD tput) or in the terminfo database (for ncurses tput). This sequence is apparently sufficient to reset Linux VC when they start typing "funny" characters. For good measure, stty (1) is called with a reasonable argument in an attempt to return the finished mode.

See also clear (1), stty (1), tput (1)

+5
source

If you just want to flush the terminal buffer, you can see the clear (1) command.

Excerpt from the clear (1) page:

 NAME clear - clear the terminal screen SYNOPSIS clear DESCRIPTION clear clears your screen if this is possible. It looks in the environment for the terminal type and then in the terminfo database to figure out how to clear the screen. ... 
0
source

All Articles