Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Pre-5.0.5 part 3: Heuristic for ZLE_RPROMPT_INDENT

On Dec 8,  1:46am, Mikael Magnusson wrote:
} I get the glitch when the resulting string is empty, but still prints
} something. Eg,
} RPS1=%b
} RPS1=%f
} RPS1=$'\0'
} produce the error while
} RPS1=' %b'
} RPS1='%f '
} don't.

I can confirm with xterm and examining the output of typescript that
printing a "visible" character (even a space) into column 80 followed
by printing a backspace leaves the cursor in column 80; whereas moving
the cursor to column 80 and then printing a nul or a control sequence
followed by a backspace moves the cursor back to column 79.

ZLE is printing the backspace because the auto-margin value reported
by the terminfo description says that printing into or beyond column
80 will wrap the line, so ZLE believes it needs to back up onto the
original line before continuing.  xterm is faking it by ignoring the
backspace when it's the first thing that is output after column 80,
but if anything else precedes the backspace, xterm loses state and
the backspace is processed even though the cursor didn't move.

I'm not sure there's any way for ZLE to deal with this without having
a lot more knowledge/control over what may appear in the prompt at
the rightmost column.  It also somehow needs to know whether the
terminal actually did wrap, or is just pretending; maybe we have
that much already.

Messages sorted by: Reverse Date, Date, Thread, Author