kovidgoyal / kitty

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

border color fails to change when moving focus to different kitty os-window #7530

Closed thenbe closed 5 months ago

thenbe commented 5 months ago

I don't know if it's fair to call this a bug. It might very well be misconfiguration or even a feature request.

As seen in the video, border color successfully changes (as expected) when moving focus to firefox (or any other app besides kitty).

However, border color fails to change only when moving focus from a kitty window to a different kitty os-window.

https://github.com/kovidgoyal/kitty/assets/33713262/8abb5029-8fea-4871-8f13-04f6e41415f4

Repro

  1. Open 2 kitty os-windows. Open 2 windows in each os-window.
  2. Focus a kitty window.
  3. Focus a different kitty os-window.
  4. .
    • ACTUAL: Observe that the kitty window (from step1) did not change border color.
    • EXPECTED: Observe that the kitty window (from step1) has its border color change from active_border_color to inactive_border_color.

Config

# kitty.conf
watcher focus-watcher.py
focus_follows_mouse true
window_border_width 5pt
window_margin_width 3
active_border_color #93B6FF
inactive_border_color #333
# ~/.config/kitty/focus-watcher.py
from typing import Any, Dict
from kitty.boss import Boss
from kitty.window import Window

def on_focus_change(boss: Boss, window: Window, data: Dict[str, Any]) -> None:
    if data["focused"]:
        boss.set_colors("active_border_color=#93B6FF")
    else:
        boss.set_colors("active_border_color=#333")

Environment details

Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its
configuration to the clipboard and paste it here. 

kitty 0.35.1 created by Kovid Goyal
Running under: X11

Colors:
    active_border_color             #93b6ff   
    color0                          #3b3b4d   
    inactive_border_color           #333333   
    visual_bell_color               #424949   

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

kovidgoyal commented 5 months ago

the color is for active window not focused window. The idea is your window manager/os will indicate what os window has focus and within that os window the kitty border color tell you which kitty window is active.