Console Annoyance

Entelin plug-discuss@lists.plug.phoenix.az.us
03 Nov 2002 19:07:00 -0700


ah excelent, I always was curious how to enter literals on the console.
Thanks good explination

On Sun, 2002-11-03 at 21:59, James Durham wrote:
> I used to have this problem too, until along time ago I read this on 
> linuxgazette.com. This should be easier for you, or may be what your looking 
> for to fix the problem after this happens. Sory no preventing it as far as I 
> know.
> 
> The folling is a quote from www.linuxgazette.com Issue 7.
> //
> 
> Restoring your screen - Kscreen revisited!
> 
> 
>  Well, here's a very handy bit of information that I recently came across 
> while skimming through one of the Linux newsgroups. 
> 
> 
> Remember the 'ol "kscreen" shell function that restored sanity to a screen 
> that had gotten all buggered up? Well, here's a very cogent explanation of 
> what's happening and how to fix it. The author of this was Henry Wong and 
> here's his message: 
> 
> >Sometimes, when I inadvertently cat a binary file and get junk on my
> >screen, that screen goes into some sort of graphics mode and I can't get
> >it out of it.  I've tried changing fonts and SOMETHING changes, stty
> >doesn't do anything, capital letters may still appear.  I can switch to
> >another virtual console and everything is fine.  When I type commands on
> >my messed up (must remember this is going out to the world, use
> >euphemisms) terminal it seems to understand.  I can exit for instance,
> >or reboot, though what is echoed to the screen is screwed up.
> 
> >On sunsite (and mirrors), there's a file called fixvt.sh or something in
> >the (I think) system/console directory.  It'll clean this up.
> 
> I've done this to myself also.
> 
> The console appears to be using some sort of VT100 (or similar)
> emulation.  This emulation has two modes: G0 which is usually normal
> text and G1 which is usually graphics (these can be changed but is
> usually not).  When sending binary text to the screen any ^n (== '\f')
> character will switch the emulator to G1 (graphics) mode whereas any ^o
> (== '\r') will switch to G0 (normal text) mode.
> 
> To force it back you need to have a shell or other program to send the
> ^o to the stricken display.  I often switch to another virtual terminal
> and do an "echo -e '\017' >/dev/tty2" (assuming that tty2 is the
> stricken terminal) to restore it back to text mode.
> 
> Of course you can put this into a shell program with the tty? as the
> parameter.
> 
> Hope this helps.
> 
> Henry Wong
> 
> 
>  So, want to see that this works? Try this: 
> 
> 
> In BASH, you can enter literal characters using the vi-type key sequence 
> control-v (that's hitting the control key and the letter "v" simultaneously) 
> followed by the character you want to insert. So, enter the following at the 
> command prompt: 
> 
>                 ^v^n
> 
>  That's a control-v followed by a control-n combination. Hit the ENTER key 
> and... 
> 
> ShaaaZZzzamm!, instant trashed console! Except now, we know that the terminal 
> isn't really "trashed" but merely in graphics mode. All that needs to be done 
> is return it to text mode. 
> 
> 
> Now, you can "blindly" enter the following: 
> 
>         ^v^o
> 
>  Hit the ENTER key, and your screen is back to normal. You could also use 
> Henry's suggestion for echoing a similar string to the afflicted VT from 
> another VT. That is, presuming that tty2 was the afflicted VT, switch to 
> another VT and then use Henry's command: 
>         echo -e '\017' >/dev/tty2
> 
> 
>  Thanks, Henry!! 
> \\ The following is a end quote from www.linuxgazetee.com Issue 7
> 
> On Sunday 03 November 2002 08:29 am, Entelin wrote:
> > When one reads in a binary file to the display it has the chance of
> > somehow altering the characters that are used to print normal text so
> > its unreadable and scrambled up. Loging that term out doesnt have any
> > effect.  How is it that this can be fixed or prevented ?
> >
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> > To subscribe, unsubscribe, or to change  you mail settings:
> > http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss