Skip to content

Add optional window title bars for window splits#9450

Open
mcrmck wants to merge 2 commits intokovidgoyal:masterfrom
mcrmck:pane-title-bar
Open

Add optional window title bars for window splits#9450
mcrmck wants to merge 2 commits intokovidgoyal:masterfrom
mcrmck:pane-title-bar

Conversation

@mcrmck
Copy link

@mcrmck mcrmck commented Feb 1, 2026

Summary

  • Adds an optional, configurable title bar displayed above or below each window when multiple windows are visible in a tab
  • Title bars are GPU-rendered using virtual Screen objects (same model as the tab bar) and automatically hidden when only a single window is visible
  • Follows up on discussion Interest Check: Per-Window Labels/Titles Visible in Splits #9448 — implements the feature as opt-in (disabled by default) per maintainer guidance

Configuration options

# Enable/disable and position (default: none)
window_title_bar none|top|bottom

# Template (same syntax as tab_title_template)
window_title_template '{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.window}{progress_percent}{title}'
active_window_title_template none

# Colors (default: none, falls back to tab bar colors)
window_title_bar_active_foreground   none
window_title_bar_active_background   none
window_title_bar_inactive_foreground none
window_title_bar_inactive_background none

# Text alignment
window_title_bar_align left|center|right

Implementation

  • C layer (state.h, state.c, child-monitor.c): Each Window struct gains a window_title_render_data field with its own VAO. Cell data is uploaded to the GPU in prepare_to_render_os_window and drawn in render_prepared_os_window.
  • Layout (layout/base.py): _apply_window_title_bars() shrinks each visible window's geometry by one cell height to make room for the title bar.
  • Rendering (window_title_bar.py): WindowTitleBarManager manages one WindowTitleBarScreen per visible window, handling template evaluation, SGR formatting, alignment, and cleanup.
  • Integration (tabs.py): Title bars update on layout changes (relayout_borders) and title changes (title_changed).
  • Custom rendering: Users can place a window_title_bar.py script in their kitty config directory with a draw_window_title(data) function, exposed as {custom} in templates (same pattern as tab bar's tab_bar.py).

Changes since initial submission

Addressed all reviewer feedback from @kovidgoyal:

  1. Renamed panewindow in all option names and internals
  2. Use foreground/background instead of fg/bg in color option names
  3. Color options use to_color_or_none, default to None, fall back to corresponding tab bar colors (active_tab_foreground, etc.) — no theme updates needed
  4. Custom Python script support via window_title_bar.py in config dir (mirrors tab_bar.py pattern)
  5. Default template includes bell and progress info using existing bell_on_tab and tab_activity_symbol options, matching the tab bar's default template

Test plan

  • Build compiles cleanly
  • All existing tests pass
  • Config options parse correctly with expected defaults
  • Manual testing: title bars appear/disappear correctly with splits, stack mode, layout switching, and window resizing

Ref: #9448

🤖 Generated with Claude Code

Add an optional title bar that displays above or below each window pane
when multiple windows are visible in a tab. This is similar to tmux's
pane-border-format or Terminator's pane title bars.

New configuration options:
- pane_title_bar: none/top/bottom (default: none)
- pane_title_template: f-string template (same syntax as tab_title_template)
- active_pane_title_template: override for active pane
- pane_title_bar_active_fg/bg: colors for active pane title
- pane_title_bar_inactive_fg/bg: colors for inactive pane titles
- pane_title_bar_align: left/center/right text alignment

The title bars are rendered using virtual Screen objects registered with
the GPU, following the same model as the tab bar. Title bars are
automatically hidden when only a single window is visible.

Ref: kovidgoyal#9448

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kovidgoyal
Copy link
Owner

kovidgoyal commented Feb 1, 2026

Before I find time to review the actual code, just some high level comments.

  1. Options should not use pane but window as these are called windows not panes in kitty. Also to be consistent with the tab bar they should use foreground/background not fg/bg.

  2. The color options should use to_color_or_none and when none use the corresponding colors from the tab bar. They should default to None. Otherwise all the existing kitty color themes would need to be updated with these four colors.

  3. There should be a way to customise the rendering using a python script just as there is for tab bars (I dont know if this is already implemented)

  4. The default template should include bell and progress information just as the default template for the tab bar does.

- Rename all options from pane_title_* to window_title_*
- Use foreground/background instead of fg/bg in color option names
- Change color options to to_color_or_none defaulting to None,
  falling back to corresponding tab bar colors
- Add bell_symbol, activity_symbol, progress_percent template vars
  using existing bell_on_tab and tab_activity_symbol options
- Add custom script support via window_title_bar.py in config dir
  (draw_window_title function exposed as {custom} in templates)
- Update C structs, Python references, and regenerate config files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mcrmck mcrmck changed the title Add optional pane title bars for window splits Add optional window title bars for window splits Feb 1, 2026
@mcrmck
Copy link
Author

mcrmck commented Feb 1, 2026

Thank you for your feedback.

I have pushed a commit addressing all four points:

  1. Renamed all options from pane_title_*window_title_*
  2. Color options now use foreground/background instead of fg/bg
  3. Color options use to_color_or_none, default to None, and fall back to the corresponding tab bar colors
  4. Added custom Python script support via window_title_bar.py in the config directory (same pattern as tab_bar.py)
  5. Default template now includes bell and progress info, reusing the existing bell_on_tab and tab_activity_symbol options to match the tab bar"--jq '.html_url'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants