# ~/.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.
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.
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
active_border_color
toinactive_border_color
.Config
Environment details
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.