Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was just ssh'd into my server (Ubuntu 10.04.2), and I ran aptitude (in interactive mode). Once I pressed one key (one of the letters, g I believe), it turned into this (not just the SSH session; this behaviour continued after I terminated the ssh session):

Term 1

Term 2

I can reconnect and everything will be okay, but when I run aptitude again, the same issue happens (but, strangely enough, is contained to within aptitude).

Does anybody have any idea what could be happening? If it helps, I'm running screen with a byobu profile, my $TERM is screen-bce, and I'm using on 10.6.7.

share|improve this question
happened several times to me as well! – tekknolagi Oct 26 '11 at 7:14
up vote 2 down vote accepted

You could use the command reset to get your normal terminal back.

As to why this is happening - somehow, your terminal is getting binary data as opposed to ASCII.

share|improve this answer
This is usually the result of viewing vs. executing a binary program. cat {binary file} will often do it. – Chris Nava Apr 9 '11 at 4:28
@Chris True - but I'm leaving room open to speculation because this is upon login. My guess is a .bashrc issue, but we can't be sure :) – new123456 Apr 9 '11 at 18:47
So should I assume that this is because aptitude is somehow outputting binary data? * gets ready to file bug report * – squircle Apr 10 '11 at 23:18

I realize this thread is almost a year old, but since I just encountered this problem myself after using "cat" to display the contents of an executable in Apple's, I figure that this situation may affect future users too.

Any way, as far as I can tell, the weird characters appear after the ASCII "shift out" character (decimal 14, 0x0E) is printed. (Well, the word "printed" might not be appropriate because, at least for, this is not a printable character, but I hope you know what I mean.) Fortunately, the terminal goes back to normal if the ASCII "shift in" character (decimal 15, 0x0F) is printed.

In other words, if one wrote a C program like...

#include <stdio.h>
int main() {
   printf( "\x0F" );
   return 0;

It should turn everything back to normal. There is probably an even easier way in a different language or within the bash shell, but hopefully you get the idea.

Apparently, this strange behavior is not a bug, but rather an obscure (to me, at least) feature. When I searched for information, I was directed to ISO 2022, which seems to be the basis for what the terminal is doing. Here is the Wikipedia article on ISO/IEC 2022.

I hope this post was helpful now that the mystery behind the strange characters is cleared up.

share|improve this answer

The menu item

Terminal > Shell > Send Reset

resets the terminal state to the defaults, including the character set, which resolves this specific issue.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .