on Fri, Apr 26, 2002 at 09:37:50AM +0100, Jenny_Hopkins@toby-churchill.com wrote:
I'm constantly opening binary files using cat from the command line by mistake, then after quitting out the console displays all text in weird symbols. Is there anyway to reset the console when this happens?
Others have mentioned the handy 'reset'; zsh has a neat feature (well, it has several):
ttyctl -fu The -f option freezes the tty, and -u unfreezes it. When the tty is frozen, no changes made to the tty settings by exter- nal programs will be honored by the shell, except for changes in the size of the screen; the shell will simply reset the settings to their previous values as soon as each command exits or is suspended. Thus, stty and similar programs have no effect when the tty is frozen. Without options it reports whether the terminal is frozen or not.
Using less rather than cat can save time too, as it can display binary files in a bearable format.