vfc*_*sts 2 gnu-screen zsh oh-my-zsh
每当我在其中创建一个新窗口时,gnu screen
我通常会给它一个在断开连接之间持续存在的名称,但我注意到当我在窗口中运行命令时,标题的oh-my-zsh
分布zsh
会被重置。基本上,它被复位到(x* ~)
哪里x
是窗口数量。
不仅如此,当我在该窗口的远程会话中运行命令时,如果远程 shell 是zsh
. 这不会发生在bash
.
例如,假设我在屏幕中创建了一个标题为 as 的新窗口(2* ~)
,然后将标题设置为user@remotehost
因为我要连接到remotehost
as user
。当我跑去ssh user@remotehost
连接时remotehost
,标题恢复为(2* ~)
. 当remotehost
我运行我不想要htop
的标题更改时htop
。
zsh
即使它连接到另一个会话,它似乎也正在将远程窗口命令传播到本地窗口的标题中。这似乎只zsh
发生在bash
. 是否有一些设置 zsh
或oh-my-zsh
覆盖了以前的行为?我没有改变,.screenrc
切换到zsh
这里。
# got a fancy hardstatus line noted below
hardstatus on
hardstatus alwayslastline
# hardstatus string "%w"
# blagged this hardstatus like from https://bbs.archlinux.org/viewtopic.php?id=55618, not quite sure what it does
# extended from http://unix.stackexchange.com/questions/195209 and , uptime command disabled
# http://www.gnu.org/software/screen/manual/html_node/String-Escapes.html#String-Escapes
hardstatus string '%{= kG}%{C}Screen:%{Rk}Host:%H %1`%{c}%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{C} %d-%m %{W}%c %{g}]'
backtick 1 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID[^[:space:]]*" | cut -d '.' -f 2'
# backtick 2 60 60 /usr/bin/uptime
Run Code Online (Sandbox Code Playgroud)
可以.zshrc
通过取消注释行来禁用它:
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
Run Code Online (Sandbox Code Playgroud)
它应用于函数omz_termsupport_precmd
和omz_termsupport_preexec
,它们在~/.oh-my-zsh/lib/termsupport.zsh
归档时间: |
|
查看次数: |
2098 次 |
最近记录: |