On Tue, 2 May 2006 15:50:18 +0200, Allard Welter <[EMAIL PROTECTED]> wrote:

Does anyone know how to get a (console) terminal to reset by itself
after accidentally cat'ing a binary file. I do this regularly and have
gotten used to issuing a 'setterm -reset' in binary font. It would
please me though if did not have to do this each time.

It's usually better to avoid dumping a binary file to the terminal than to clean up the result ;-) I'm not sure if you are doing this because of carelessness (aka "going too fast!")
or because you're not sure of the tools to use. Here are a few tips:
* To avoid the problem you describe, I have got into the habit of checking unknown files
with file(1) before trying to display them.
* If it is binary and you want to search for text, try the strings(1) command from binutils package. * Less(1) is also safe for displaying binary files as long as you don't use the -r option.

Still, despite all the above, sometimes shit happens.
In that case `setterm -reset' is the correct solution. You might be interested to add the something like this to your .bashrc file:
   alias rt='setterm -reset'
Then you can recover your teminal with 3 keystrokes: <r> <t> <Enter>

Brandon


--
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to