reedline
reedline copied to clipboard
Transient prompt support
Possible alternative to #195
Powerline prompts can be nice, but they can also fill the scrollback history with a lot of visual noise. Some readline implementations support transient prompts, in which after the user hits 'enter', the fancy powerline prompt is replaced with a much simpler prompt.
Here is an example with zsh's powerlevel10k:

This definitively needs additional support from reedlines side to paint a different prompt after submission of an entry. Good catch!
I feel like before this is done the prompting system in general should be reevaluated before, as behavior in some possible situations is not well-defined. Most importantly, how should a prompt behave on line break characters in certain parts? In its current state it behaves unexpectedly (though I'd argue there's no "expected" behavior in this case anyway).
Fig 1. Prompt::render_prompt_right returns a string with line break
Fig 2. the same as Fig 1. but in a different terminal
This might seem obvious to not do if encountered by a developer but it reflects an asymmetry within the prompt rendering code which currently inhibits arbitrary Unicode prompts, which could be right-to-left.
transient prompt was implemented a while back, thanks.