Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux command reset(1) is slow [closed]

Tags:

linux

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?

like image 724
nccc Avatar asked Oct 04 '12 01:10

nccc


People also ask

What does reset command do in Linux?

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.

How do I reset xterm?

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 do I reset the console in Linux?

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.


1 Answers

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.

like image 150
Barmar Avatar answered Oct 12 '22 10:10

Barmar