zsh-workers
 help / color / mirror / code / Atom feed
* Prompt wrapping problems since 42285 ("off by one fix in multiple prompts ")
@ 2018-05-10 22:27 ` Alexandros Kozak
  2018-05-14  8:51   ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandros Kozak @ 2018-05-10 22:27 UTC (permalink / raw)
  To: zsh-workers

I have an asynchronous ZSH prompt
(https://github.com/agkozak/agkozak-zsh-theme) that works quite well in ZSH
4.3.11-5.4.2. Ever since v5.5 came out, I've been having a lot of trouble
when the prompt wraps; the cursor frequently appears a few characters back
from where it should. Eliminating the RPROMPT sometimes helps a bit, but
even then, if I enter something and then delete the line, the cursor will
snap back on top of the text of the left prompt, not at its end.

A simple test demonstration can be had (without downloading my prompt) by
loading v5.5 or v5.5.1 with zsh -f and then entering

    PROMPT='abc@def
~/abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz %# '

Make the terminal window narrow or the type very large so that the prompt
wraps. Enter a command that wraps to the next line, then delete the command
(in vi mode, ESC d d). Depending on the width of the terminal window, the
cursor may land one or more places before it should.

If you throw in an RPROMPT, such as

    RPROMPT='(foo bar bat)'

some real ugliness can be had -- always depending, of course, on the width
of the screen. I've tested this out in Ubuntu and FreeBSD with mintty,
PuTTY, lxterminal, and Blink Shell.

Reverting the change in

	
https://github.com/zsh-users/zsh/commit/d8d9fee137a5aa2cf9bf8314b06895bfc2a0
5518

fixes the problems I've described.

Any suggestions? Many thanks in advance/


Alexandros Kozak



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Prompt wrapping problems since 42285 ("off by one fix in multiple prompts ")
  2018-05-10 22:27 ` Prompt wrapping problems since 42285 ("off by one fix in multiple prompts ") Alexandros Kozak
@ 2018-05-14  8:51   ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2018-05-14  8:51 UTC (permalink / raw)
  To: Alexandros Kozak, zsh-workers

On Thu, 10 May 2018 15:27:44 -0700
"Alexandros Kozak" <agkozak@gmail.com> wrote:
> I have an asynchronous ZSH prompt
> (https://github.com/agkozak/agkozak-zsh-theme) that works quite well
> in ZSH 4.3.11-5.4.2. Ever since v5.5 came out, I've been having a lot
> of trouble when the prompt wraps; the cursor frequently appears a few
> characters back from where it should. Eliminating the RPROMPT
> sometimes helps a bit, but even then, if I enter something and then
> delete the line, the cursor will snap back on top of the text of the
> left prompt, not at its end.

Bart pointed out when this patch appeared that terminal behaviour simply
isn't well-defined enough that all of them have consistent wrapping
behaviour, and they don't even provide enough information for the shell
to decide by itself.

About the only possibility we have to is to expand the ability to
configure the settings (we currently have ZLE_RPROMPT_INDENT, which can
be set to 1 to try to massage our way out of trouble).

pws


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-14  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180510222848epcas1p217b8864e4a44eaba7f15d4a48f1836a7@epcas1p2.samsung.com>
2018-05-10 22:27 ` Prompt wrapping problems since 42285 ("off by one fix in multiple prompts ") Alexandros Kozak
2018-05-14  8:51   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).