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

Wrong bg/fg on custom separators #403

Open
2 tasks done
vdbe opened this issue Oct 22, 2024 · 10 comments
Open
2 tasks done

Wrong bg/fg on custom separators #403

vdbe opened this issue Oct 22, 2024 · 10 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@vdbe
Copy link
Contributor

vdbe commented Oct 22, 2024

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

  • Something is really actually broken.

Is there an existing issue outlining your problem?

  • 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

%if "#{==:#{@catppuccin_status_background},default}"
set -gF @_ctp_status_bg "#{@thm_mantle}"
set -gF status-style "bg=#{@_ctp_status_bg},fg=#{@thm_fg}"
%hidden CTP_MESSAGE_BACKGROUND="#{@thm_overlay_0}"
%elif "#{==:#{@catppuccin_status_background},none}"
set -g status-style "default"
set -g @_ctp_status_bg "none"
%hidden CTP_MESSAGE_BACKGROUND="default"
%else
# Treat @catppuccin_status_background as a format string.
set -gF status-style "bg=#{E:@catppuccin_status_background},fg=#{@thm_fg}"
set -gF @_ctp_status_bg "#{E:@catppuccin_status_background}"
%hidden CTP_MESSAGE_BACKGROUND="#{E:@catppuccin_status_background}"
%endif

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 vdbe added the bug Something isn't working label Oct 22, 2024
@kjnsn
Copy link
Collaborator

kjnsn commented Oct 26, 2024

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

@kjnsn kjnsn added the help wanted Extra attention is needed label Oct 26, 2024
@xdannyrobertsx
Copy link

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

@kjnsn
Copy link
Collaborator

kjnsn commented Nov 23, 2024

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

@xdannyrobertsx
Copy link

xdannyrobertsx commented Nov 23, 2024

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!

@xafarr
Copy link
Contributor

xafarr commented Dec 4, 2024

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

@vdbe
Copy link
Contributor Author

vdbe commented Dec 4, 2024

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

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

@thomastthai
Copy link

thomastthai commented Dec 6, 2024

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

@xafarr
Copy link
Contributor

xafarr commented Dec 7, 2024

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 " "

@thomastthai
Copy link

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.

@kjnsn
Copy link
Collaborator

kjnsn commented Dec 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants