0

I recently upgraded to Debian 10, which has tmux version 2.8-3. I copied over my old tmux conf file. For unnamed windows, the behavior was to show the process name with arguments, ie "vim foo.txt". Now unfortunately it just shows the process name, ie, "vim" so I am unable to distinguish between dozens of windows I have open currently. (Lots of projects being worked on at once, tmux is beyond crucial to my workflow) How do I revert to the old behavior?

Also, it shows the hostname for each window. Is there any way I can hide this unless that window is sshed to another machine? I don't need to see my own hostname hundreds of times over and over.

I am not having an issue with windows getting renamed, so don't worry about that.

.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'

1 Answer 1

0

tmux never renames the window to include process arguments, so your shell must be doing it.

allow-rename defaults to off from tmux 2.7, so your shell will not be able to rename them. Try turning it on again.

I don't understand where you are seeing the hostname, are you talking about tree mode? The hostname is the default pane title, but this has been the case for years and years. You can remove it in tree mode by specifying an alternative format with choose-tree -F. If you upgrade to 2.9 or later, you can see the default format with tmux display -p "#{tree_mode_format}" and remove the "#{pane_title}" bit. Here it is anyway:

$ 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),}}}

Alternatively you try setting a different default pane title either by using hooks in tmux and selectp -T (for example https://unix.stackexchange.com/a/564690/341374) or by putting printf "\033]2;title\007" in your PS1.

3
  • Thank you. Unfortunately setting allow-rename had no effect. Not sure exactly how, but the old version of tmux had the full process name, ie "vim foo.txt". The old version of tmux I was using was from Debian 8, so tmux version 1.9-6. Using zsh.
    – cat pants
    Jan 31, 2020 at 19:43
  • Your shell was setting it, that is the only possibility. Are you sure you turned allow-rename on correctly? Check tmux show -g allow-rename. Also you will probably need to do something in the shell before it sets the name again, or possibly log out and in again. Also are you sure you didn't update anything else at the same time as tmux, maybe your shell or the default shell profiles? Jan 31, 2020 at 20:38
  • Thank you! Let me try that. Also I didn't copy my .zshrc file over yet, so perhaps that's the source of the issue.
    – cat pants
    Jan 31, 2020 at 22:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .