bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiline editing breaks if the previous output doesn't end in newli


From: Greg Wooledge
Subject: Re: Multiline editing breaks if the previous output doesn't end in newline
Date: Sun, 30 Oct 2022 21:47:08 -0400

On Mon, Oct 31, 2022 at 03:40:34AM +0200, Oğuz wrote:
> >         Option B: Fix the line editor to take into account when the
> > prompt doesn't start at column 0.
> >
> >
> Yeah, or add a new prompt sequence (e.g. \N) that prints a newline only if
> the cursor is not at column 0.

There's no 100% portable way to determine where the cursor is.

Shells like zsh that show a special symbol in these cases use a hack
to do so.  There's a good explanation in this answer:

https://unix.stackexchange.com/questions/167582/why-zsh-ends-a-line-with-a-highlighted-percent-symbol#answer-302710



reply via email to

[Prev in Thread] Current Thread [Next in Thread]