ターミナルの表示が崩れたときの対処法 - Clouder::Bloggerより。少し改良
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# The sequence ESC[2J clears the terminal, and ESCc resets the terminal. | |
echo -en "\x1B[2J\x1B\x63" |
端末上でバイナリファイルの中身をうっかり出力させてしまってウィンドウの表示がえらいことになることが時々あったので、この解決方法はありがたいです。ただしBSD由来のshでは、echoコマンドがエスケープシーケンスを理解するためのオプション(-e)を理解してくれないので注意(ksh,zshなど他のシェルまでは分かりませんが)。
0 件のコメント:
コメントを投稿