reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Transient prompt support

Open jmoore34 opened this issue 3 years ago • 1 comments

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: transient 2

jmoore34 avatar Mar 14 '22 22:03 jmoore34

This definitively needs additional support from reedlines side to paint a different prompt after submission of an entry. Good catch!

sholderbach avatar Mar 14 '22 22:03 sholderbach

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).

image Fig 1. Prompt::render_prompt_right returns a string with line break

image 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.

cactusdualcore avatar Jan 07 '23 17:01 cactusdualcore

transient prompt was implemented a while back, thanks.

fdncred avatar Dec 28 '23 00:12 fdncred