zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Pre-5.0.5 part 3: Heuristic for ZLE_RPROMPT_INDENT
Date: Sun, 07 Dec 2014 20:20:30 -0800	[thread overview]
Message-ID: <141207202030.ZM24480@torch.brasslantern.com> (raw)
In-Reply-To: <CAHYJk3RN2iA4jxhZF3Kgi-0tpEwWxYL4ZfvNSbGWstZAv02S=w@mail.gmail.com>

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.


      reply	other threads:[~2014-12-08  4:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-02 21:58 Bart Schaefer
2014-02-07  9:45 ` Oliver Kiddle
2014-02-07 16:46   ` Bart Schaefer
2014-02-08 19:58     ` Bart Schaefer
2014-02-17 16:12       ` Mikael Magnusson
2014-02-17 18:34         ` Bart Schaefer
2014-12-08  0:46           ` Mikael Magnusson
2014-12-08  4:20             ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=141207202030.ZM24480@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).