tmux icon indicating copy to clipboard operation
tmux copied to clipboard

Wrong bg/fg on custom separators

Open vdbe opened this issue 1 year ago • 1 comments

I am not requesting help with my configuration and believe something is genuinely broken.

  • [X] Something is really actually broken.

Is there an existing issue outlining your problem?

  • [X] I have searched the existing issues and they do not solve my problem.

Describe your problem.

The separators bg (foreground of the separator) is not set correctly.

This was reported in #396 but closed because it's a support question?

In 2.0 the way the separators work was change if you want █ as a separator you need to use (the inverse).

I don't know if this is intended or a bug either way the color's are not set correctly on the separator.

Expected behavior:

  • The left part of left separator should be the color of the status bar.
  • Middle separator:
    • the part against text should have the bg of the text color
    • the part against the number should have the number bg
  • Right separator right part should have the color of the status bar

Deeper look:

$ tmux display-message -p "#{E:window-status-current-format}"
#[fg=#11111b,bg=#9399b2] 2#[fg=#cdd6f4,bg=#313244] default

The left separator #[fg=#11111b,bg=#9399b2] foreground should be the color of the status bar background bg=#181825.

$ tmux display-message -p "#{E:status-style}"
bg=#181825,fg=#cdd6f4

The middle and right separator should be styled correctly or documented that it does not set fg/bg like every other separator.

The that the status bar color is is not directly known in the users config since it's set by this if else block https://github.com/catppuccin/tmux/blob/c3fab98ab4248a2a78c8193ad48f0991b7bfa1e3/catppuccin_tmux.conf#L3-L19 making it difficult to set this correctly in the users config.

If the middle and right separators are not styled correctly these can just be removed since it's provides no value over adding them to _text. into something @catppuccin_window_number and @catppuccin_window_text bringing 4 options to two without losing functionality.

Paste your configuration.

set -g default-terminal screen-256color
set -g @test_config "tmux"
set -g mouse on

set -g status-right-length 100
set -g status-left ""

set -g @catppuccin_window_status_style "custom"

set -g @catppuccin_window_flag "icon"

set -g @catppuccin_window_text " default"
set -g @catppuccin_window_current_text " current"

# set -g @catppuccin_window_number_position "right"

# Pre 2.0 separators
# set -g @catppuccin_window_left_separator "█"
# set -g @catppuccin_window_middle_separator "█"
# set -g @catppuccin_window_right_separator ""

set -g @catppuccin_window_left_separator " "
set -g @catppuccin_window_middle_separator ""
set -g @catppuccin_window_right_separator ""

run "$CATPPUCCIN_TMUX_PLUGIN"

Attach screenshots.

Current: image image Expected (old colors): image

What tmux version are you seeing the issue on?

tmux 3.5a

Any additional comments?

No response

vdbe avatar Oct 22 '24 13:10 vdbe

Potentially a solution for #409 could fix this at the same time

kjnsn avatar Oct 26 '24 01:10 kjnsn

FWIW, i'm running into this but only on my linux machine running sway. My other machines (macOs Sonoma and Catalina), which use the same dotfiles, display the separators just fine

xdannyrobertsx avatar Nov 23 '24 04:11 xdannyrobertsx

FWIW, i'm running into this but only on my linux machine running sway. My other machines (macOs Sonoma and Catalina), which use the same dotfiles, display the separators just fine

What terminal are you using? The window manager is irrelevant

kjnsn avatar Nov 23 '24 06:11 kjnsn

FWIW, i'm running into this but only on my linux machine running sway. My other machines (macOs Sonoma and Catalina), which use the same dotfiles, display the separators just fine

What terminal are you using? The window manager is irrelevant

im using alacritty with the same toml config for all my machines.

i mentioned Sway because Wayland can be weird about transparency- i don't know enough about it yet to point to why that is, ive just seen it mentioned online, so i could be totally wrong about that.

my status line background color is set to "none" and that's the only time i see this come up with my separators (again, this only happens on Wayland), so it might be a totally different issue - if so, i'm happy to delete my comments as i'm just trying to help! Please let me know!

xdannyrobertsx avatar Nov 23 '24 18:11 xdannyrobertsx

@vdbe Just wondering if this is still happening with the latest update.

xafarr avatar Dec 04 '24 09:12 xafarr

@vdbe Just wondering if this is still happening with the latest update.

@xafarr don't know no longer use catppuccin/tmux.

vdbe avatar Dec 04 '24 09:12 vdbe

This bug has been an issue since updating catppuccin/tmux with breaking changes. It appears when using "custom", e.g. set -g @catppuccin_window_status_style "custom"

Relevant system info:

  • macOS Sequoia 15.1.1
  • iTerm2 v3.5.10
  • tmux v3.5a
  • catppuccin/tmux at commit 1795723 (Mon Nov 18 09:33:58 2024 +1100)

Image showing the wrong bg/fg:

image

Relevant tmux.conf part:

set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavor 'mocha'

# Load catppuccin for TPM
run ~/.config/tmux/plugins/tmux/catppuccin.tmux

set -g @catppuccin_status_background 'default' # default, none, #00CCFF, or #{@thm_<color>}

set -g status-right-length 100
set -g status-left ""

# Window
set -g @catppuccin_window_status_style "custom"
set -g @catppuccin_window-status-separator ""

## Window global/default configuration
set -g @catppuccin_window_text " #{window_name}"
set -g @catppuccin_window_status "icon"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_number_position "left"

set -g @catppuccin_window_left_separator "█"
set -g @catppuccin_window_middle_separator "█"
set -g @catppuccin_window_right_separator "█"

## Window current configuration
set -g @catppuccin_window_current_text "#{window_name}"
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_window_current_middle_separator "#[reverse] 󰿟 #[noreverse]"

# Status line options
set -ogq @catppuccin_status_left_separator ""
set -ogq @catppuccin_status_middle_separator ""
set -ogq @catppuccin_status_right_separator "█"
set -ogq @catppuccin_status_connect_separator "yes" # yes, no
set -ogq @catppuccin_status_fill "none"
set -ogq @catppuccin_status_module_bg_color "#{@thm_surface_0}"

# Status
set -g status-right "#{E:@catppuccin_status_application}"
set -gF  status-right "#{@catppuccin_status_directory}"
set -agF status-right "#{@catppuccin_status_user}"
set -agF status-right "#{@catppuccin_status_host}"
set -agF status-right "#{@catppuccin_status_session}"

The bg/fg colors are not correctly set as shown below:

❯ tmux display-message -p "#{E:window-status-format}"
#[fg=#11111b,bg=#9399b2]█3█#[fg=#cdd6f4,bg=#313244] tmux█

❯ tmux display-message -p "#{E:window-status-current-format}"
#[fg=#11111b,bg=#cba6f7]█3#[reverse] 󰿟 #[noreverse]#[fg=#cdd6f4,bg=#45475a]tmux█

❯ tmux display-message -p "#{E:status-style}"
bg=#181825,fg=#cdd6f4

thomastthai avatar Dec 06 '24 08:12 thomastthai

For custom settings, you'll have to set the colors yourself. Try the following config

set -g @catppuccin_window_left_separator "#[fg=#{@_ctp_status_bg},reverse]█#[none]"
set -g @catppuccin_window_middle_separator "#[fg=#{@_ctp_status_bg}] #[none]"
set -g @catppuccin_window_right_separator "#[fg=#{@_ctp_status_bg},reverse]█#[none]"

## Window current configuration
set -g @catppuccin_window_current_text "#{window_name}"
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_window_current_middle_separator " "

xafarr avatar Dec 07 '24 03:12 xafarr

I looked at the code in tmux/catppuccin_tmux.conf and used that to experiment. Here is the result and some changes made:

image
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavor 'mocha'

# Load catppuccin for TPM
run ~/.config/tmux/plugins/tmux/catppuccin.tmux

set -g @catppuccin_status_background 'default' # default, none, #00CCFF, or #{@thm_<color>}

set -g status-right-length 100
set -g status-left ""

# Window
set -g @catppuccin_window_status_style "custom"
set -g @catppuccin_window-status-separator ""

## Window global/default configuration
set -g @catppuccin_window_text " #{window_name}"
set -g @catppuccin_window_text_color "#{@thm_surface_0}"
set -g @catppuccin_window_number_color "#{@thm_surface_0}"
set -g @catppuccin_window_status "icon"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_number_position "left"

set -g @catppuccin_window_left_separator   "#[fg=#{@_ctp_status_bg},reverse]█#[none]"
#set -g @catppuccin_window_middle_separator "#[fg=#{@catppuccin_window_number_color},bg=#{@catppuccin_window_text_color}]█"
set -gq @catppuccin_window_middle_separator \
      "#[fg=#{@thm_bg},bg=#{@catppuccin_window_number_color}] 󰿟"
set -g @catppuccin_window_right_separator  "#[fg=#{@_ctp_status_bg},reverse]█#[none]"

## Window current configuration
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_window_current_text_color "#{@thm_surface_1}"
set -g @catppuccin_window_current_number_color "#{@thm_surface_2}"
set -g @catppuccin_window_current_text " #{window_name}"
set -g @catppuccin_window_current_fill "all"
#set -gq @catppuccin_window_current_middle_separator \
#      "#[fg=#{@catppuccin_window_text_color},bg=#{@catppuccin_window_current_number_color}] 󰿟"
set -g @catppuccin_window_current_middle_separator "#[fg=#{@catppuccin_window_current_number_color},bg=#{@catppuccin_window_current_text_color}]█"

I learned that there are design restrictions or assumptions that make customizing challenging. For example, @catppuccin_window_number_color has a bias for light colors because the number itself is dark and not easily changeable. The color of the window text isn't configurable to my knowledge. I understand the decision behind simplifying design choices at the cost of giving up more nuanced control of design elements.

Another %elif block like %elif "#{==:#{@catppuccin_window_status_style},slanted}" for custom would address the issue raised originally and cover most basic custom layouts.

thomastthai avatar Dec 07 '24 06:12 thomastthai

I learned that there are design restrictions or assumptions that make customizing challenging. For example, @catppuccin_window_number_color has a bias for light colors because the number itself is dark and not easily changeable. The color of the window text isn't configurable to my knowledge. I understand the decision behind simplifying design choices at the cost of giving up more nuanced control of design elements.

Another %elif block like %elif "#{==:#{@catppuccin_window_status_style},slanted}" for custom would address the issue raised originally and cover most basic custom layouts.

I feel that for custom layouts, just set the tmux options for window formats, don't use the catppuccin window formats at all. It's much, much simpler and avoids a combinatorial explosion of options that will only serve to confuse everyone.

kjnsn avatar Dec 07 '24 07:12 kjnsn