[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resetting console in text mode



Gaven Cohen <dragon@wastelands.net> writes:

> ok, here's a question I've always had and never got round to finding out
> the answer to.
> 
> Sometimes, and only very rarely, my console will lock up.  Either I'll
> "be" in text mode, but the screen will just have some graphic junk on it
> even though I can type stuff and see reactions to what I type [in the
> shell], or the keyboard won't work either.
> 
> In these cases, I can still telnet in from my other machine.  So my
> question is, how can I [through telnet] reset the console (the reset
> command doesnt do much) so I can once again use the machine?

There are at least 3 ways to fix a hosed console:

   stty sane
   reset
   echo ""

(you need to put Ctrl-O in quotes, this can be done with bash's
quoting facility, i.e. Ctrl-V). 

Indeed, keyboard mappings can get screwed up, and this can happen even 
before you log in. In such cases, you can log in onto another console
(or telnet), and use the commands above, redirecting them to the hosed
console like this (assume /dev/tty1 is hosed):

   stty sane </dev/tty1
   reset >/dev/tty1
   echo "" >/dev/tty1

Note that stty works on the device connected to stdin, not stdout.

For the "real geeks" (I never tried it, I guess I am not enough of a
real geek :) - any character can be typed at a console by holding the
left Alt key and typing its ascii code as a 3-digit zero padded
decimal number on the keypad. You can, in principal, log in and give
one of the commands above directly on the hosed console. ;-)

Credit is due where it belongs: I learned this from H.J.Stein quite a
while ago.

-- 
Oleg Goldshmidt          goldshmt@netvision.net.il   
BLOOMBERG L.P. (BFM)     oleg@bfr.co.il