From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: since 4.3.4, artifact-appearance at prompt
Date: Sun, 04 Nov 2007 15:48:39 -0800 [thread overview]
Message-ID: <071104154839.ZM22918@torch.brasslantern.com> (raw)
In-Reply-To: <20071104221621.GB28076@blorf.net>
On Nov 4, 2:16pm, Wayne Davison wrote:
} Subject: Re: since 4.3.4, artifact-appearance at prompt
}
} On Sun, Nov 04, 2007 at 09:48:03AM -0800, Bart Schaefer wrote:
} > function precmd {
} > # An efficient version using termcap multi-right:
} > print -nP '%B%S%#%s%b' # Output % or #
} > echotc RI $((COLUMNS - 3))
} > echo -n ' ' # Output 2 spaces
} > }
}
} You should replace the 2-space echo with a print that also outputs a CR:
}
} print -n ' \r'
In that case we ought to update both the FAQ, and the C code that
handles PROMPT_SP. I copied the above right out of the FAQ, except
for changing the first "print".
} Yes, the PROMPT_CR option is going to output a CR too, but it does so
} after enough of a delay that I would sometimes see an inverted % on an
} empty line if my type-ahead echoed between the PROMPT_SP output and the
} PROMPT_CR output.
This appears to be what Russell is experiencing, too.
} It is better to output the %P portion as early as possible in the
} post-command-run code, so outputting it as an actual part of the prompt
} would probably not be desirable.
I'm willing to believe that.
} e.g.:
}
} PROMPTSP=%{%B%S%}%#%{%s%b%}
The internals of prompting already know that %B%S and %s%b don't occupy
any space. %{...%} shouldn't be needed there.
} However, an alternative to having the user use %{ ... %} would be to
} have the user just tell us how wide their string is:
}
} PROMPTSP=1:%B%S%#%s%b
The countprompt() function is exported from prompt.c for ZLE's use, so
I don't think there's much to be gained there.
next prev parent reply other threads:[~2007-11-04 23:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-03 23:43 Russell Hoover
2007-11-04 1:30 ` Bart Schaefer
2007-11-04 3:48 ` Russell Hoover
2007-11-04 7:00 ` Atom Smasher
2007-11-04 17:48 ` Bart Schaefer
2007-11-04 22:16 ` Wayne Davison
2007-11-04 23:48 ` Bart Schaefer [this message]
2007-11-05 6:01 ` Wayne Davison
2007-11-05 15:16 ` Bart Schaefer
2007-11-05 11:28 ` Oliver Kiddle
2007-11-05 15:35 ` Bart Schaefer
2007-11-04 22:18 ` Wayne Davison
2007-11-04 14:51 ` Benjamin Andresen
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=071104154839.ZM22918@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.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).