E.Z*_*.Z. 50 linux bash terminal putty gnome-terminal
我不得不运行一个命令行工具(Python脚本),其输出似乎打破了我的终端.执行完成后,输入的反馈消失了(我看不到我正在键入的内容),也没有显示换行符.如果终端通过远程启动出现这种情况Putty
,而且在本地使用时gnome-terminal
.
例如,问题发生后,如果我输入ENTER pwd
ENTER,我希望看到:
[userA@host006 ~]$
[userA@host006 ~]$ pwd
/home/userA
[userA@host006 ~]$
Run Code Online (Sandbox Code Playgroud)
但实际上输出是:
[userA@host006 ~]$ [userA@host006 ~]$ /home/userA
[userA@host006 ~]$
Run Code Online (Sandbox Code Playgroud)
修复它的唯一方法是关闭该终端并启动一个新终端.
也许是相关的:脚本输出包含一些基于终端的格式化(例如,反转前景/背景以突出显示某些状态消息).如果我将此输出转储到文件,我可以看到类似的东西[07mSome Message Here[0m
.
我有什么想法可以防止这种情况发生?
To elaborate on Joshua Briefman's answer, executing reset -c
will only reset the control characters responsible for your problem:
tset
,reset
- terminal initialization
Usage: tset [options] [terminal]
Options:
-c set control characters
-e ch erase character
-I no initialization strings
-i ch interrupt character
-k ch kill character
-m mapping map identifier to type
-Q do not output control key settings
-r display term on stderr
-s output TERM set command
-V print curses-version
-w set window-size
Run Code Online (Sandbox Code Playgroud)
Also note the following form the the command's manual:
Note, you may have to type
Run Code Online (Sandbox Code Playgroud)<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.
归档时间: |
|
查看次数: |
21723 次 |
最近记录: |