Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tmux window names are not respected #53

Closed
aimestereo opened this issue Jul 9, 2023 · 8 comments
Closed

Tmux window names are not respected #53

aimestereo opened this issue Jul 9, 2023 · 8 comments

Comments

@aimestereo
Copy link

aimestereo commented Jul 9, 2023

Notes:

  • I have latest version installed via TPM.
  • I don't know if this behaviour by design, but at least it smth that should be configurable.

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: dreamsofcode-io@b4e0715
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

pic 2: alternative - window names are respected, if not set, shows current program name

Screenshot 2023-07-09 at 12 24 40


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


@aimestereo aimestereo changed the title Tmux window names are not shown Tmux window names are not respected Jul 9, 2023
rjmccabe3701 pushed a commit to rjmccabe3701/linux_config_custom that referenced this issue Jul 28, 2023
@89iuv
Copy link
Collaborator

89iuv commented Aug 10, 2023

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
Copy link
Collaborator

89iuv commented Aug 11, 2023

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.

@89iuv 89iuv closed this as completed Aug 11, 2023
@aimestereo
Copy link
Author

@89iuv works, thanks

@zezking
Copy link

zezking commented Nov 4, 2024

The above configs only display window name 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
Copy link

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!

@jnussbaum
Copy link

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!

And my hero, too!

I think this should actually be added to the recommended default configuration. IMHO, these 2 pages are not accurate, and should be updated:

I'd be happy to open a PR, what do you think, @89iuv ?

@kjnsn
Copy link
Collaborator

kjnsn commented Jan 30, 2025

Happy to accept a PR to change the default config in the readme and the customisation page

@jnussbaum
Copy link

Happy to accept a PR to change the default config in the readme and the customisation page

Thanks for your prompt response. The PR is ready here: #472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants