我最近升级到Debian 10,它有tmux版本2.8-3。我复制了我以前的tmux conf文件。对于未命名的窗口,其行为是显示带有参数的进程名,即"vim foo.txt“。不幸的是,它只显示了进程名,即"vim“,因此我无法区分当前打开的几十个窗口。(大量项目同时进行,tmux对我的工作流程是至关重要的)我如何恢复旧的行为?
另外,它还显示了每个窗口的主机名。除非那扇窗户被扔到另一台机器上,否则我能把它藏起来吗?我不需要一遍又一遍地看我自己的主机名。
我对windows被重命名没有任何问题,所以不要担心。
.tmux.conf:
unbind C-b
# Are both of these next two lines necessary?
set -g prefix C-a
bind C-a send-prefix
set -g default-terminal "screen-256color"
set-option -g visual-bell off
set -g base-index 1
# Keep original window selection behavior but commented out for now
# bind-key -r -T prefix w run-shell 'tmux choose-tree -Nwf"##{==:##{session_name},#{session_name}}"'
bind-key W command-prompt -p "Switch to pane with pid:" "run-shell 'pane=\$(ps eww %% | sed \"1d; s/^.*TMUX_PANE=//;s/ .*//\"); [[ -z \$pane ]] && tmux display-message \"could not find pid\" || tmux switch-client -t \$pane'"
bind r source-file ~/.tmux.conf
set -g pane-active-border-style fg=green,bg=green
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-strategy-vim 'session'
set-option -g renumber-windows on
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
发布于 2020-01-31 06:28:26
tmux从不将窗口重命名为包含进程参数,因此您的shell必须这样做。
allow-rename
默认设置为tmux2.7,因此您的shell将无法重命名它们。再开一次。
我不明白你在哪里看到主机名,你说的是树模式吗?主机名是默认窗格标题,但多年来一直是这种情况。通过使用choose-tree -F
指定另一种格式,可以在树模式下删除它。如果升级到2.9或更高版本,可以看到tmux display -p "#{tree_mode_format}"
的默认格式并删除"#{pane_title}"
位。不管怎么说,这就是:
$ tmux display -p "#{tree_mode_format}"
#{?pane_format,#{pane_current_command} "#{pane_title}",#{?window_format,#{window_name}#{window_flags} (#{window_panes} panes)#{?#{==:#{window_panes},1}, "#{pane_title}",},#{session_windows} windows#{?session_grouped, (group #{session_group}: #{session_group_list}),}#{?session_attached, (attached),}}}
或者,通过在tmux和selectp -T
中使用钩子(例如https://unix.stackexchange.com/a/564690/341374)或在PS1中放置printf "\033]2;title\007
,尝试设置不同的默认窗格标题。
https://unix.stackexchange.com/questions/565032
复制相似问题