You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line 1 right-alignment is implemented by baking spaces into PROMPT (lower_first_line pads to exactly columns, src/render/mod.rs:168). The string is rendered once per precmd with the COLUMNS value of that moment. When the terminal shrinks afterwards (pane split, window resize), zsh redisplays the same static string into a narrower terminal and the line wraps mid-segment:
… koutei/readOnly
(ap-northeast-1) 22:16:
39
(observed after splitting a pane; the aws segment and the clock tear across three lines). The prompt only recovers at the next precmd.
Cause
src/shell/init.zsh registers preexec/precmd/zshexit/line-init hooks only — there is no TRAPWINCH. zsh updates COLUMNS and redisplays the prompt on SIGWINCH, but redisplay re-expands the existingPROMPT string; the padding computed for the old width is baked in. Any prompt that right-aligns via padding (rather than RPROMPT, which zsh reflows natively but only supports on the final line) must re-render on resize — powerlevel10k and starship both do this.
Proposed fix
Add a TRAPWINCH handler that re-sends a render request with the fresh COLUMNS and applies the reply via the existing zle -F update path (_nova_drain_and_redraw + zle reset-prompt). All plumbing already exists; the handler is a few lines.
Preserve any user-defined TRAPWINCH (call the previous definition if present), and guard against non-ZLE contexts the way _nova_register_update_handler already does.
Debounce is likely unnecessary (interactive resizes generate few WINCHes and the worker render is cheap), but coalescing by generation counter already happens on the apply side (_nova_last_applied_gen).
As of v0.3.0 (c73dc6c).
Summary
Line 1 right-alignment is implemented by baking spaces into
PROMPT(lower_first_linepads to exactlycolumns, src/render/mod.rs:168). The string is rendered once perprecmdwith theCOLUMNSvalue of that moment. When the terminal shrinks afterwards (pane split, window resize), zsh redisplays the same static string into a narrower terminal and the line wraps mid-segment:(observed after splitting a pane; the aws segment and the clock tear across three lines). The prompt only recovers at the next
precmd.Cause
src/shell/init.zshregisterspreexec/precmd/zshexit/line-inithooks only — there is noTRAPWINCH. zsh updatesCOLUMNSand redisplays the prompt onSIGWINCH, but redisplay re-expands the existingPROMPTstring; the padding computed for the old width is baked in. Any prompt that right-aligns via padding (rather thanRPROMPT, which zsh reflows natively but only supports on the final line) must re-render on resize — powerlevel10k and starship both do this.Proposed fix
TRAPWINCHhandler that re-sends a render request with the freshCOLUMNSand applies the reply via the existingzle -Fupdate path (_nova_drain_and_redraw+zle reset-prompt). All plumbing already exists; the handler is a few lines.TRAPWINCH(call the previous definition if present), and guard against non-ZLE contexts the way_nova_register_update_handleralready does._nova_last_applied_gen).Notes
🤖 Generated with Claude Code — Claude Fable 5