tmuxでペインの表示が更新されなくなる問題と端末のリセット
バイナリファイルを標準出力に投げてしまって端末エミュレータの表示がぶっ壊れるということがありますが、 tmuxでペインの表示が更新されなくなるときにもこれは使えた、という話です。
何も表示されなくなる、完全に無反応になる(^C
を入力すると反応はありますが)、という見た目に騙されて、
なにかしら自分の知らない変なモードに入っているのだと思い込んでいましたが、単に表示がぶっ壊れているだけのようです。
そもそも変な文字を標準出力に流したりしてない不思議なシチュエーションでこの現象が発生するんですよね……謎です……
知識が偏っていて、化石のような
$ echo -e \\033c $ echo ^[c
あたりは知っていたんですが、なんと
$ reset
を叩けばいいだけでした。reset
コマンドはncurses
に入っているようです。
reset
はtset
へのsymlinkです。以下man reset
より引用
When invoked as reset, tset sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state. Note, you may have to type <LF>reset<LF> (the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the abnormal state. Also, the terminal will often not echo the command.