2

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

> gpg -d oops.tar.gz.gpg

�@�����÷b�ʘ�K����L:EX��w�)܇�՘����5�     ���#[�7��ﻳ@�Ǎ
�n�Kr��Kyb��3�X���E�_?*A�wp��������DH���g�n�(�4-

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? – mosvy Aug 27 '19 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 '19 at 9:40
2

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.)

| improve this answer | |
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

| improve this answer | |
  • 1
    Or it mayn't. Try printf '\e)0\x0eabc'; stty sane. – mosvy Aug 28 '19 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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