zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Bug report
Date: Sat, 14 Dec 2013 17:15:13 -0800	[thread overview]
Message-ID: <131214171514.ZM25883@torch.brasslantern.com> (raw)
In-Reply-To: <20131214204319.2a04428f@pws-pc.ntlworld.com>

On Dec 14,  8:43pm, Peter Stephenson wrote:
}
} Seems to work: I've sanity checked for negative values and the worst I
} can see happening with large numbers is the prompt doesn't appear.

Something isn't quit right here.  In the copy-paste below, pay attention
to what happens to the left prompt; the placement of the right prompt is
correct, though vagaries of email may have muddled the line width or
wrapping:

torch% setopt promptsubst
torch% PS1=987654321_ RPS1='$ZLE_RPROMPT_INDENT'
987654321_

Cursor is immediately to the left of the "_" as expected.

987654321_ZLE_RPROMPT_INDENT=1
987654321_ZLE_RPROMPT_INDENT=2                                                1
987654321ZLE_RPROMPT_INDENT=3                                                2
98765432ZLE_RPROMPT_INDENT=4                                                3
9876543ZLE_RPROMPT_INDENT=5                                                4
987654ZLE_RPROMPT_INDENT=6                                                5
98765ZLE_RPROMPT_INDENT=7                                                6
987654321_                                                              7

Cursor is presently on the "5" digit in PS1.

9876ZLE_RPROMPT_INDENT=0                                                7
987654321_ echo oops                                                           0
oops

Cursor is now one full space to the right of the "_".  So whatever moves
the cursor "back" to PS1 after drawing RPS1 still calculates as if the
right-indent is always 1.  If I set ZLE_RPROMPT_INDENT to a value larger
than the number of characters in $PS1 but smaller than $COLUMNS, the
cursor actually moves up to the line above, which I can't really show
with cut-and-paste.

It appears that if you want to make this offset different from 1, you
are going to have to change countprompt() to include the offset in the
width of the prompt rather than just fiddle with math in the output code.


  reply	other threads:[~2013-12-15  1:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-14 18:44 Patrick Oscity
2013-12-14 19:08 ` Bart Schaefer
2013-12-14 20:43   ` Peter Stephenson
2013-12-15  1:15     ` Bart Schaefer [this message]
2013-12-15 13:30       ` Peter Stephenson
2013-12-15 17:10         ` Bart Schaefer
2013-12-15  1:08   ` Patrick Oscity
2013-12-15 11:01   ` Patrick Oscity
  -- strict thread matches above, loose matches on Subject: below --
2021-03-01  9:43 BUG REPORT ZheNing Hu
2021-03-01 15:27 ` Daniel Shahaf
2021-03-01 17:32 ` Bart Schaefer
2021-03-05  7:51   ` ZheNing Hu
2019-09-19 11:16 Bug report Vladimir Deyter
2019-09-19 14:53 ` Mikael Magnusson
2019-09-19 15:57   ` Daniel Shahaf
2014-12-26 16:53 mvxxc
2014-12-27  2:35 ` Bart Schaefer
2014-09-17  0:26 bug report Mica Chimera
2014-09-17  1:08 ` Frank Terbeck
2014-06-05 17:05 robin terrep-drangiug
2014-06-05 20:48 ` Bart Schaefer
2013-12-17 10:59 Bug report Patrick Oscity
2013-12-17 11:27 ` Peter Stephenson
2013-12-17 17:11 ` Bart Schaefer
2013-12-17 17:56   ` Bart Schaefer
2013-08-04 12:16 Bug Report Yuusuke Yoshimoto
2013-08-04 17:58 ` Peter Stephenson
1996-05-22  0:07 Bug report Felix von Leitner
1996-05-15  7:48 Martin Birgmeier
1996-05-10  8:30 Martin Birgmeier
1995-08-24 11:23 Bug Report Carsten Friedrich

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=131214171514.ZM25883@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).