catppuccin / tmux

💽 Soothing pastel theme for Tmux
MIT License
1.95k stars 615 forks source link

Tmux window names are not respected #53

Closed aimestereo closed 1 year ago

aimestereo commented 1 year ago

Notes:

Issue

If I rename window (or even pane), names in the bottom shows smth different (current folder?). For now I'm using this version that doesn't have this issue: https://github.com/dreamsofcode-io/catppuccin-tmux/commit/b4e0715356f820fc72ea8e8baf34f0f60e891718 Regretfully I can't be more useful, I don't even know if this version fixes smth, or if there's a bug in latest commits in main repo (https://github.com/dreamsofcode-io/catppuccin-tmux is quite behind main repo)

Examples

pic 1: main - wrong window names ![Screenshot 2023-07-09 at 12 23 22](https://github.com/catppuccin/tmux/assets/2869535/a06e7d21-cb3d-4347-89bd-1e8b2778eaf4)
pic 2: alternative - window names are respected, if not set, shows current program name ![Screenshot 2023-07-09 at 12 24 40](https://github.com/catppuccin/tmux/assets/2869535/a3e629b3-2b3a-410f-92a1-6d23232bc28a)

Additional info

My config, only relevant part:

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'dreamsofcode-io/catppuccin-tmux'  # catppuccin with more info in bottom line
set -g @plugin 'catppuccin/tmux'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

My whole config

set -s mouse on

unbind C-b
set-option -g prefix M-a
bind-key M-a send-prefix

# Start windows and panes # with 1 (not 0), and renumber on close.
set -g base-index 1
set -g pane-base-index 1
set-option -g renumber-windows on

# set vi mode for selection and copy
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

# forget the find window.  That is for chumps
bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"

# Shift Alt vim keys to switch windows.
bind -n M-H previous-window
bind -n M-L next-window

# Custom keys for splits + Open splits in the same directory
bind 's' split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"

#
# List of plugins
#
# prefix + I - to [I]nstall plugins
# prefix + U - to [U]pdate plugins
# prefix + alt + u - to [U]ninstall plugins that are not in the list
#
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'  # catppuccin with more info in bottom line
#set -g @plugin 'catppuccin/tmux'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

#
# Complex configs
#

# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h'  'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j'  'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k'  'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l'  'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
    "bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\'  'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
    "bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\'  'select-pane -l'"

bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
bind-key -T copy-mode-vi 'M-\' select-pane -l
89iuv commented 1 year ago

It looks like catppuccin is not configured to show the name of a window when it has been renamed. I am looking into a fix to override the window name when a user manually sets the name.

89iuv commented 1 year ago

With the new settings you need to use the following: set -g @catppuccin_window_default_text "#W" set -g @catppuccin_window_current_text "#W"

This will set the status bar window to display the window name.

aimestereo commented 11 months ago

@89iuv works, thanks

zezking commented 3 weeks ago

The above configs only display window name in when a window is selected for me. If you want the window name to displayed by default. Add the following line along with the configs provided by @89iuv set -g @catppuccin_window_text "#W"

andreabertanzon commented 15 hours ago

The above configs only display window name in when a window is selected for me. If you want the window name to displayed by default. Add the following line along with the configs provided by @89iuv set -g @catppuccin_window_text "#W"

You're my hero!