Wednesday, March 4, 2009

Re: [BLUG] How do you like to get rid of terminal corruption?

>> Quoting Mark Krenz <mark@slugbug.org>:
>>> Ok, just kidding. I'm curious though, how do you usually like to get
>>> rid of terminal corruption? Do you just close the terminal or are you
>>> daring and try to reverse it by cat'ing out /dev/urandom or /dev/sda?
>>> Sometimes I'll try cat'ing /dev/urandom, but something makes me think
>>> that its dangerous to do that. Anyone know?
>>
> On Wed, Mar 04, 2009 at 01:06:21PM -0500, Gillis, Chad wrote:
>> What does cat /dev/urandom acheive? Doesn't that just say spew random
>> garbage? Is it the homeopathic method? :)
>

Quoting Steven Black <blacks@indiana.edu>:
> The issue is that some garbage sent to the terminal emulator mucked
> up some setting and now you can't read any new text. The scroll back
> is unimpacted, presuming that wasn't cleared or just swamped. (This is
> due to the problem being the character set being set oddly. VT100's
> supported a concept of an 'alternate' character set which would contain
> characters not normally in the main character set. You could send a
> control sequence to change the character set. This allowed for non-Latin
> glyphs on some models of those early terminals.)

Thanks for the interesting explanation. So I have another question
now. The purpose of cat is to print to standard output. Since the
role of /dev/urandom is to produce random numbers, it makes sense that
the stuff being printed to standard out would be uninterpretable
gibberish. But how do you go from printing to standard out to sending
a command to the terminal to change its settings? If I hadn't already
seen my terminal get mucked up in the past, I might have thought that
you'd just get gibberish up until /cat/udev was finished, and then
after that things would be normal again. Does the terminal just assume
that if it's expected to print gibberish once then it should go forever
into gibberish mode? This is my simple perception of it but I'm sure
there's a better explanation.

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

No comments: