reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Connected prompt support

Open jmoore34 opened this issue 3 years ago • 4 comments

A nice feature that zsh's powerlevel10k supports is connecting the left and right prompt with a solid or dotted line: image

In action: image

In addition it might be nice to be able to tweak the color of the connector.

jmoore34 avatar Mar 14 '22 20:03 jmoore34

Do you want to use it with nushell or in a separate project? For solutions in pure nu @fdncred is probably the prompt maestro, getting the different prompt plugins like starship or oh-my-posh to work. He probably knows if reedline needs to provide additional features to make that smooth.

sholderbach avatar Mar 14 '22 22:03 sholderbach

I was thinking in nushell; perhaps the ansi command could be used to figure out the terminal width or such

jmoore34 avatar Mar 14 '22 23:03 jmoore34

I don't know if the PROMPT_COMMAND currently supports dynamic resizing. (i.e. execute nu code once or frequently/whenever necessary) Reedline is using crossterm to listen via terminal raw mode for those resize events. Getting info back from the terminal via control sequences, is not particularly fast.

sholderbach avatar Mar 14 '22 23:03 sholderbach

we have tools already that understand the terminal's width, otherwise we wouldn't be able to hid the right prompt when the text from the left prompt invades its space. if the left prompt had text and a newline and the right prompt had text and a new line we might be able to draw a line between the top left prompt and top right prompt. it would need to be experimented with to figure out if it would work. one could start looking at the oh-my.nu script in nu_scripts.

fdncred avatar Mar 14 '22 23:03 fdncred