Re: Fix corrupted terminal output

2008-09-24 Thread Chris St Denis

Andreas Davour wrote:

On Tue, 23 Sep 2008, Chris St Denis wrote:

Occasionally, I accidentially cat a binary file or a directory casing 
the terminal output to be corrupted with text looking like (don't 
know if this will make it through the mail cleanly)


  E ??? ?? ?.
  2#


To fix this normally I just close the window and open a new ssh 
connection, but I am wondering if there is a more clean way to do 
this. I've tried reset(1), but it doesn't seem to help any.


What termnial emulator are you using? KDE Konsole have an "Edit->Reset 
& Clear Terminal" menu alternative that usually manages to clear such 
problems up for me.


/Andreas



I use putty ssh client (on windows). I had thought it was a console 
change rather than terminal editor specific.


I'll try the things people have suggested here next time it happens.


Thanks for the suggestions.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Fix corrupted terminal output

2008-09-23 Thread Wayne Sierke
On Tue, 2008-09-23 at 17:09 -0700, Chris St Denis wrote:
> Occasionally, I accidentially cat a binary file or a directory casing 
> the terminal output to be corrupted with text looking like (don't know 
> if this will make it through the mail cleanly)
> 
> E ??? ?? ?.
> 2#
> 
> 
> To fix this normally I just close the window and open a new ssh 
> connection, but I am wondering if there is a more clean way to do this. 
> I've tried reset(1), but it doesn't seem to help any.

The terminal has probably switched to an alternate charset mode. I
recently encountered this situation while using tmux and found that
issuing 'reset' was ineffectual. To recover from this try issuing a \017
character to the terminal, or the escape sequence: ^[[m. How you can do
that most easily depends on which shell you're using at the time, so you
can try:

/bin/echo ^v^o  (^v is ctrl-v  ^o is ctrl-o)
/bin/sh -c "echo -e \\017"
/bin/echo ^v^[[m
/bin/sh -c "echo -e \\033[m"

Thanks go to Nicholas Marriott for pointing out this solution.


Wayne


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Fix corrupted terminal output

2008-09-23 Thread Stephen Hurd
Try this one:
perl -e 'print "\x0f"'

- Original Message -
From: Chris St Denis <[EMAIL PROTECTED]>
Date: Tuesday, September 23, 2008 5:09 pm
Subject: Fix corrupted terminal output

> Occasionally, I accidentially cat a binary file or a directory 
> casing 
> the terminal output to be corrupted with text looking like (don't 
> know 
> if this will make it through the mail cleanly)
> 
>E ??? ?? ?.
>2#
> 
> 
> To fix this normally I just close the window and open a new ssh 
> connection, but I am wondering if there is a more clean way to do 
> this. 
> I've tried reset(1), but it doesn't seem to help any.
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-
> [EMAIL PROTECTED]"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"