Skip to content

refactor(config): replace line-level right blocks with layout.rprompt #59

Description

@lemtoc

As of v0.3.1 (9e938b4).

Summary

layout.line1.right and layout.line2.right look symmetric but have different rendering semantics. The input-line right block becomes zsh native RPROMPT, while layout.line1.right in a two-line layout is emulated by baking enough spaces into PROMPT to reach COLUMNS.

That emulated first-line alignment makes the prompt width-dependent and is the root cause described in #44: after a pane split or terminal shrink, zsh redisplays a multiline prompt containing padding computed for the previous width.

Proposed fix

Make the right prompt independent of the configured line count:

[layout]
lines = 2
rprompt = ["time"]

[layout.line1]
left = ["dir", "git_branch", "git_status"]

[layout.line2]
left = ["exit_status", "prompt_char"]
  • layout.rprompt always lowers to the shell-native input-line RPROMPT for both one-line and two-line layouts.
  • Prompt line tables contain left-side segments only.
  • Remove first-line padding and its dedicated fitting path from the renderer.
  • Move the default time segment and all examples to layout.rprompt.
  • Accept legacy line-level right keys for one compatibility release, normalize them into layout.rprompt, and emit an actionable deprecation warning.
  • Reject or clearly diagnose ambiguous configurations that mix the new and legacy forms.
  • Update configuration, renderer, worker, CLI, snapshot, and documentation coverage.

Acceptance criteria

Notes

This is a prerequisite and root-cause simplification for #44. It intentionally does not add TRAPWINCH, terminal-specific semantic markers, or preprompt rendering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Second priority: quality and infrastructurearea:configComponent: configarea:renderComponent: renderbreaking-changeChanges user-facing behavior or config compatibilityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions