I pressed CtrlAltF1 to enter TTY1. I worked a while mainly on vim, then my shell (bash) stops echoing.

If I type echo abc it does not get display.

Instead I get a screen like this: Bash shell with cascading lines

How do I fix the problem?

  • I doubt you typed in a TTY. (unless you took an old teletype, smashed the screen and put a keyboard inside). My guess is that you opened a shell on a normal (non graphics) screen and from the prompt typed echo abc, but it would be nice if you could confirm this and post the output (e.g. the result is an empty line, is there an error code, anything else, ... ?)
    – Hennes
    Jan 30, 2016 at 14:54
  • 3
    teletypes didn't have screens. Jan 30, 2016 at 15:01
  • @Hennes I pressed Ctrl+Alt+F1 to enter tty1, then I worked a while, mainly on vim, the display problem happened. Then I typed the command sh (sh is linked bash in my system). Similar display problems have occurred several times, so I want to deal with the issue.
    – tmpbin
    Jan 30, 2016 at 15:03
  • So best guess is that when you used vim some setting messed up the settings? YOu could try to reset those with reset (Tomas's link seems to indicate it is part of ncurses) assuming you are a non root user with that reset in your path and are not calling an aliased shutdown - always fun...). stty sane is also mentioned and worth trying, though most of the time I have to follow that with an stty erase ^h to get backspace working again.
    – Hennes
    Jan 30, 2016 at 15:09
  • stty sane is adequate; reset does a little more (and duplicates stty sane, more or less). Jan 30, 2016 at 15:35

1 Answer 1


ttys are complex beasts, which can work in several different modes. E.g. when running vi(1), you don't want characters typed to show up on screen, the editor is in charge of what is displayed. This is called "raw" mode. Usually you are in "echo" mode, in which the kernel sends what is typed to the screen directly. If a program which took over the details of the display crashes and doesn't restore the mode before exiting, all sorts of weird stuff gets displayed when typing. Another popular way to screw up the settings is to sed a binary file (e.g. an executable or an image) to the screen, they are prone to contain the key sequences to change settings...

The way to restore the tty settings to normal is to run the command reset, which is done by ^Jreset^J (the ^J is ctrl-J, press the ctrl and J keys simultaneously).

ctrl-J is what C calls '\n', NEWLINE, it ends the previous line the shell was reading (if any); reset is the command; ctrl-J ends the line and makes the shell run the command. This nonsense is needed since the return key generates '\r', CARRIAGE RETURN, which the normal mode translates into ´\n' for convenience.

Welcome to the intricacies of Unix roots.

Not the answer you're looking for? Browse other questions tagged or ask your own question.