zsh-workers
 help / color / mirror / code / Atom feed
From: mason@primenet.com.au (Geoff Wing)
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: 3.1.6* (Was: Weird behaviour with certain PS1-sequences)
Date: 3 Oct 1999 09:04:26 GMT	[thread overview]
Message-ID: <slrn7ve70p.l4d.mason@coral.primenet.com.au> (raw)
In-Reply-To: <9909280854.AA28230@ibmth.df.unipi.it>

Peter Stephenson <pws@ibmth.df.unipi.it> typed:
:Dan Nelson wrote:
:> % zsh -f
:> % PROMPT="%m %n %/ %%"
:> dan dan /home/dan % TERM=dumb
:> dan dan /home/dan % 
:>                     ^ blanks start here and don't stop
:
:Yes, I can see this, and what's going wrong, in the refresh code.
:Unfortunately I'm not sure I understand the logic well enough to fix it,
:though if Geoff doesn't get around to it I will have to try.
:
:The spaces in the prompt match what is on the line already at that point,
:i.e. nothing.  singmoveto() is called to skip over them, one by one.
:(Since we're skipping only one character in this example, it would
:presumably be more efficient just to output it, but that's a different
:question.) 

The problem is that if we're in singlerefresh() mode then we don't use
the normal prompt anyway.  Since we're using a different prompt we can't
do prompt writing in tc_rightcurs().

--- Src/Zle/zle_refresh.c.org	Thu Jul 15 18:27:59 1999
+++ Src/Zle/zle_refresh.c	Sun Oct  3 18:48:00 1999
@@ -945,7 +945,7 @@
 /* otherwise _carefully_ write the contents of the video buffer.
    if we're anywhere in the prompt, goto the left column and write the whole
    prompt out unless ztrlen(lpromptbuf) == lpromptw : we can cheat then */
-    if (vln == 0 && i < lpromptw) {
+    if (vln == 0 && i < lpromptw && !(termflags & TERM_SHORT)) {
 	if (strlen(lpromptbuf) == lpromptw)
 	    fputs(lpromptbuf + i, shout);
 	else if (tccan(TCRIGHT) && (tclen[TCRIGHT] * ct <= ztrlen(lpromptbuf)))


-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874


      parent reply	other threads:[~1999-10-03  9:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-27 19:14 Weird behaviour with certain PS1-sequences Juhapekka Tolvanen
1999-09-27 19:57 ` Bart Schaefer
1999-09-27 20:03   ` Juhapekka Tolvanen
1999-09-27 22:06   ` Dan Nelson
1999-09-28  8:54     ` Peter Stephenson
1999-10-03  8:15       ` PATCH: 3.1.6: promptexpand (Re: Weird behaviour with certain PS1-sequences) Bart Schaefer
1999-10-03  9:04       ` Geoff Wing [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=slrn7ve70p.l4d.mason@coral.primenet.com.au \
    --to=mason@primenet.com.au \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).