From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Zsh Workers" <zsh-workers@sunsite.dk>
Subject: PATCH: %y modifier in prompt substitution RE: %l prompt expansion change
Date: Thu, 21 Jun 2001 13:46:20 +0400 [thread overview]
Message-ID: <002801c0fa37$063a8e60$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <Pine.LNX.4.33L2.0106201122380.805-100000@phong.blorf.net>
>
> One solution might be to restore the old %l behavior and put the new,
> consistent tty-output behavior onto a new expansion, like %y, perhaps.
>
I hope this suites everybody ...
-andrej
BTW the list of characters in prompt subst manual is hopelessly out of
order.
Index: Src/prompt.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v
retrieving revision 1.6
diff -u -r1.6 prompt.c
--- Src/prompt.c 2001/06/06 16:38:50 1.6
+++ Src/prompt.c 2001/06/21 09:45:33
@@ -515,6 +515,14 @@
break;
case 'l':
if (*ttystrname) {
+ ss = (strncmp(ttystrname, "/dev/tty", 8) ?
+ ttystrname + 5 : ttystrname + 8);
+ stradd(ss);
+ } else
+ stradd("()");
+ break;
+ case 'y':
+ if (*ttystrname) {
ss = (strncmp(ttystrname, "/dev/", 5) ?
ttystrname : ttystrname + 5);
stradd(ss);
Index: Doc/Zsh/prompt.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/prompt.yo,v
retrieving revision 1.3
diff -u -r1.3 prompt.yo
--- Doc/Zsh/prompt.yo 2000/07/13 11:20:46 1.3
+++ Doc/Zsh/prompt.yo 2001/06/21 09:45:34
@@ -120,7 +120,12 @@
(24/12 hour clock) in the same way.
)
item(tt(%l))(
-The line (tty) the user is logged in on.
+The line (tty) the user is logged in on without tt(/dev/) prefix.
+If name starts with tt(/dev/tty) this is stripped.
+)
+item(tt(%y))(
+The line (tty) the user is logged in on without tt(/dev/) prefix.
+It does not treat tt(/dev/tty*) specially.
)
item(tt(%?))(
The return code of the last command executed just before the prompt.
next prev parent reply other threads:[~2001-06-21 9:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20010619140521.A13262@dman.com>
[not found] ` <handler.s.R.99297392428467.info.0@bugs.debian.org>
2001-06-19 18:10 ` Clint Adams
2001-06-19 18:34 ` Andrej Borsenkow
2001-06-20 17:01 ` Bart Schaefer
2001-06-20 17:34 ` Andrej Borsenkow
2001-06-20 17:38 ` Clint Adams
2001-06-20 17:52 ` Andrej Borsenkow
2001-06-20 18:24 ` Wayne Davison
2001-06-21 9:46 ` Andrej Borsenkow [this message]
2001-06-22 8:26 ` PATCH: %y modifier in prompt substitution " Andrej Borsenkow
2001-06-22 9:31 ` Peter Stephenson
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='002801c0fa37$063a8e60$21c9ca95@mow.siemens.ru' \
--to=andrej.borsenkow@mow.siemens.ru \
--cc=zsh-workers@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).