The console command reset(1)
is, I think too slow. On my machine, it takes 1 sec wall time to execute.
Why is this? Can it be made fast? Alternatively, is there another command that can erase my terminal buffer?
reset command in Linux system is used to initialize the terminal. This is useful once a program dies leaving a terminal in an abnormal state. Note that you may have to type reset to get the terminal up and work, as carriage-return may no longer be work in the abnormal state.
In addition to resetting your Terminal, Reset and Clear clears the visible Terminal screen space and the scrollback contents. To Reset and Clear your Terminal: Press the menu button in the top-right corner of the window and select Advanced ▸ Reset and Clear. To obtain the prompt press Enter .
How to clear it? type reset . In gnome-terminal and others, you can press Ctrl + Shift + k . In general, Look for a menu Reset and Clear.
I ran strace reset
, and saw this near the end:
nanosleep({1, 0}, 0x7fffe32053e0) = 0
So it's deliberately waiting a second after sending all the terminal reset codes, probably because some terminals need time to process everything.
You shouldn't need to use reset
very often (only when a full-screen program has terminated abnormally, so it doesn't reset the terminal itself), why is this a big deal?
I'm not sure what you mean by "erase my terminal buffer". That's not what reset
is for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With