Linux Screen 窗口标题不断变化

Linux Screen 窗口标题不断变化

每次我进入新目录时,屏幕窗口标题都会更改为主机名:。需要保留窗口的手动名称更改。

这是所有 /etc/screenrc 配置。请注意,这是一台 IT 管理的机器,我无法更改此文件。

deflogin on
vbell on
vbell_msg "   Wuff  ----  Wuff!!  "
termcap  facit|vt100|xterm|xterm-* LP:G0
terminfo facit|vt100|xterm|xterm-* LP:G0
termcap  vt100 dl=5\E[M
terminfo vt100 dl=5\E[M
termcap  facit al=\E[L\E[K:AL@:dl@:DL@:cs=\E[%i%d;%dr:ic@
terminfo facit al=\E[L\E[K:AL@:dl@:DL@:cs=\E[%i%p1%d;%p2%dr:ic@
termcap  sun 'up=^K:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:IC=\E[%d@:WS=1000\E[8;%d;%dt'
terminfo sun 'up=^K:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC:IC=\E[%p1%d@:WS=\E[8;%p1%d;%p2%dt$<1000>'
termcap  hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
terminfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
termcap wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
terminfo wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
bind ^k
bind ^\
bind \\ quit
bind K kill
bind I login on
bind O login off 
bind } history
startup_message off 
pow_detach_msg "Screen session of $LOGNAME $:cr:$:nl:ended."
defscrollback 1000
termcapinfo xterm* OL=100
termcapinfo xterm|xterm-* 'VR=\E[?5h:VN=\E[?5l'
termcapinfo xterm|xterm-* 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcapinfo   xterm|xterm-* 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
termcapinfo xterm* be
termcapinfo wy75-42 xo:hs@
termcapinfo wy* CS=\E[?1h:CE=\E[?1l:vi=\E[?25l:ve=\E[?25h:VR=\E[?5h:VN=\E[?5l:cb=\E[1K:CD=\E[1J
termcapinfo  hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'

termcap  vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC
termcapinfo linux C8
hardstatus string "[screen %n%?: %t%?] %h"

谢谢

答案1

问题似乎与 bash PROMPT_COMMAND 有关。屏幕窗口标题会根据 PROMPT_COMMAND 进行更改。因此,只需取消设置 PROMPT_COMMAND 即可解决问题。

相关内容