kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.11k stars 972 forks source link

Far right edge of tab bar color not reinitialized during remote "@ set-colors"... #4152

Closed erwin closed 2 years ago

erwin commented 2 years ago

Describe the bug If tab_bar_style is set to:

The right edge border of the tab bar color is updated differently than at initialization. When launched with a dark theme: image Then use kitty @ set-colors --all --configured "change_to_light_theme" The far right edge of the tab bar will preserve the original color it was launched with.

image

Here is a window that was launched with a light theme, that I used @ set-colors to toggle to a dark theme... image

Also note that changing the powerline symbol doesn't fix it, however getting rid of the tab border (ie, using the "tab separator style") is kind of a workaround...

To Reproduce Steps to reproduce the behavior:

  1. Set tab_bar_style to powerline, slant or fade
  2. Set allow_remote_control yes and set listen_on unix:/tmp/kitty
  3. Open kitty
  4. Open a 2nd tab to make sure tab bar appears
  5. cd ~/.config/kitty
  6. kitty @ set-colors --all --configured Clrs.conf
  7. Assuming you went from a dark theme to a light theme like Clrs, you should now see the inverted color artifact at the right edge of the tab bar like in my screenshots above.

Screenshots See above.

Environment details

kitty 0.23.1 created by Kovid Goyal
Linux r 5.11.0-37-generic #41-Ubuntu SMP Mon Sep 20 16:39:20 UTC 2021 x86_64
Ubuntu 21.04 \n \l
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.04
DISTRIB_CODENAME=hirsute
DISTRIB_DESCRIPTION="Ubuntu 21.04"
Running under:X11
Loaded config files:
  /etc/xdg/kitty/kitty.conf
  minkitconfig

Config options different from defaults:
allow_remote_control  y
listen_on             unix:/tmp/kitty
tab_bar_style         powerline
update_check_interval 0.0

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem.

Minimal kitty config to reproduce:

tab_bar_style powerline
allow_remote_control yes
listen_on unix:/tmp/kitty
page-down commented 2 years ago

I can reproduce the issue with the following command.

kitty --config=NONE -o tab_bar_margin_width=10 -o tab_bar_style=powerline -o tab_bar_background=#ff0000 -o background=#00ff00 -o remember_window_size=no -o initial_window_width=60c -o initial_window_height=10c -o allow_remote_control=yes -o 'map f1 remote_control set-colors --all --configured tab_bar_background=#ff00ff' bash -c 'kitty @ launch --type tab; sleep 2; kitty @ set-colors --all --configured background=#ffffff; read'

Maybe the background color of draw_data needs to be updated in tab_bar.

When tab_bar_margin_width is set, the tab bar will still have the (previous) background color on the right side.

init green bg: 1

set background white: 2

press f1 set tab_bar_background: 3

page-down commented 2 years ago

After pulling to the latest, I can still use the above command to reproduce the following problem.

The margin at the far right of the tab bar retains its previous background color.

page-down commented 2 years ago

Also, is tab_bar_margin_width more appropriate as padding? It might look better to use tab_bar_background for the whole bar, including the current margin area. I'm not sure about that. After all, the current name is margin, which means it's not part of the tab bar.

Perhaps some users want to use padding, or set the tab bar background to be the same color as the background as a workaround.

page-down commented 2 years ago

The latest commit has fixed the margin color issue on the far right. However, I noticed that the fade style seems to be abnormal at the moment and has turned into solid color tab.

kitty --config=NONE -o tab_bar_style=fade
kovidgoyal commented 2 years ago

On Sun, Oct 24, 2021 at 11:53:09PM -0700, page-down wrote:

The latest commit has fixed the margin color issue on the far right. However, I noticed that the fade style seems to be abnormal at the moment and has turned into solid color tab.

kitty --config=NONE -o tab_bar_style=fade

Looks OK for me.

page-down commented 2 years ago

Looks OK for me.

Sorry for the false report. That's exactly how fade works. This has absolutely nothing to do with this thread. When the tab title is very long, fade is a single solid tab.

page-down commented 2 years ago

Under certain layouts, after opening and closing a tab, there will be a leftover pixel of the tab bar at the bottom that will blink with the cursor.

The following uses fat layout, opens three windows, two tabs, and closes the last tab.

kitty --config=NONE -o tab_bar_style=fade -o enabled_layouts=fat -o allow_remote_control=yes bash -c 'for i in {1..3}; do kitty @ launch --title debug; done; kitty @ launch --type tab; kitty @ close-tab -m id:2'

The above is reproduced under macOS and Linux X11. It does not blink with the cursor under Linux.

kovidgoyal commented 2 years ago

This should fix it: https://github.com/kovidgoyal/kitty/commit/0e08c6c6600f90f5288a9bb9939e4c658c1702f3