restore normal pts settings 

>Sometimes if I cat a binary file by mistake, the fonts are gone, normal
>characters will not show up any more. instead, they are wired or simply
>blank. Sometimes when I break in the middle of less my screen goes
>entirely reverse video. How can I reset everything back?

The binary file has sent your terminal some control code which have placed your terminal in some non-standard mode (i.e., it is probably not a pts/tty thing). The first thing to try is a "tput reset" and/or a "tput init". If those don't help and you are working with a terminal which is emulating some descendant of the VT100 terminal you can also try a "printf \\033c". (And if you are using an Xterm you can also pull up the menu with Control-LeftMouseButton and choose the "Do Full Reset" option.)

Ken Pizzini

restore normal pts settings 

Thanks a lot Ken, Just FYI, "Do Full Reset" is ctrl-midMouse on my system (Sun OS).

restore normal pts settings 

>i had this problem a few minutes ago.
>tput reset/init didn't work..
>however printf \\033c did the trick.
>
>could you tell me what does printf \\033c mean exactly?

printf \\033c sends the sequence <ESC><c> to the standard ouput, which for non-redirected interactive sessions means to your screen. <ESC><c> tell vt100-like terminals to do a full reset, thus (among other things) placing them in normal-text mode.

Ken Pizzini

documented on: 08-16-99