From 2219979a65d72b524efb8df7afdf50d605c7eb9b Mon Sep 17 00:00:00 2001 From: Lauri Gates Date: Sun, 10 May 2026 10:05:22 +0300 Subject: [PATCH] feat(kitty): prefix tab titles with cwd basename Adds tab_title_template using tab.active_oldest_wd so the directory name leads each tab title and survives truncation. For tabs that emit OSC 0/2 (vim, ssh, the Claude TUI) the program-set title is appended after a separator. Caps rendered length at 50 cells. Claude Code uses Node's process.title rather than OSC 2, but kitty still picks the title up via window.title, so the prefix and the Claude task description both render. Co-Authored-By: Claude Opus 4.7 (1M context) --- private_dot_config/private_kitty/kitty.conf.tmpl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/private_dot_config/private_kitty/kitty.conf.tmpl b/private_dot_config/private_kitty/kitty.conf.tmpl index a2f936d..1d8bb30 100644 --- a/private_dot_config/private_kitty/kitty.conf.tmpl +++ b/private_dot_config/private_kitty/kitty.conf.tmpl @@ -324,6 +324,20 @@ inactive_tab_font_style normal #: Tab bar colors and styles +tab_title_template "{(tab.active_oldest_wd or '').rsplit('/', 1)[-1] or '~'}{f' · {title}' if title else ''}" + +#: Show the cwd basename as a directory prefix in the tab title. Claude +#: Code sets the title via process.title (not OSC 2), so {title} stays +#: empty for Claude tabs — the cwd basename is the useful signal there. +#: For tabs running vim/ssh/etc. that DO emit OSC 0/2, append " · {title}" +#: after the cwd. tab.active_oldest_wd uses proc_pidinfo on macOS — a +#: live per-render syscall, but cheaper than tab.active_wd. + +tab_title_max_length 50 + +#: Hard cap on rendered tab title cells. The cwd prefix sits at the +#: front so it survives truncation when {title} is long. + #: # endregion #: Color scheme # region