I suspect we've all done something similar to this:

> gpg -d oops.tar.gz.gpg

�@�����÷b�ʘ�K����L:EX��w�)܇�՘����5�     ���#[�7��ﻳ@�Ǎ

resulting in command characters being sent to the terminal and causing all kinds of strange things to happen. Ordinarily, one would type reset and the terminal would go back to normal.

However, when using Screen, corruption seems to persist after reset, resulting in the status line being duplicated and various other entertaining effects. Is there any way of restoring everything to a sensible default in a manner similar to reset?

  • 3
    Doesn't "ctrl-a shift-z enter" fix it either?
    – user313992
    Aug 27, 2019 at 9:36
  • @mosvy I think that helped. It doesn't clear the name of the window, which turned out to be the cause of some of the problems, but I think both were needed. Thanks!
    – user234461
    Aug 27, 2019 at 9:40

2 Answers 2


typing stty sane may work. It is equivalent to

stty cread -ignbrk brkint -inlcr -igncr icrnl -iutf8 -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

which sets all special characters to their default values

  • 1
    Or it mayn't. Try printf '\e)0\x0eabc'; stty sane.
    – user313992
    Aug 28, 2019 at 21:54

Many of the problems actually result from the name of the Screen window containing weird characters. The name can be changed back to something without control characters using C-a A to edit the window name. Standard Emacs key combinations can be used (e.g. C-a a C-k).

C-a Z will then reset the terminal to its default values. (Thanks to @mosvy.)

You must log in to answer this question.

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