Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: prompt expansion %l inconsistency
- X-seq: zsh-workers 14766
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "ZSH Workers Mailing List" <zsh-workers@xxxxxxxxxx>
- Subject: RE: prompt expansion %l inconsistency
- Date: Wed, 6 Jun 2001 19:37:33 +0400
- Importance: Normal
- In-reply-to: <000a01c0ecdf$83aa1d80$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
>
> It expands to number for /dev/tty<-> (2 for /dev/tty2) and base name (e.g.
> pts/5 for /dev/pts/5) for anything else. Anybody objects if I change it to
> consistently return ${$(tty)#/dev/}?
>
Silence ...
-andrej
Index: Src/prompt.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v
retrieving revision 1.5
diff -u -r1.5 prompt.c
--- Src/prompt.c 2001/03/29 12:06:24 1.5
+++ Src/prompt.c 2001/06/06 15:28:57
@@ -515,8 +515,8 @@
break;
case 'l':
if (*ttystrname) {
- ss = (strncmp(ttystrname, "/dev/tty", 8) ?
- ttystrname + 5 : ttystrname + 8);
+ ss = (strncmp(ttystrname, "/dev/", 5) ?
+ ttystrname : ttystrname + 5);
stradd(ss);
} else
stradd("()");
Messages sorted by:
Reverse Date,
Date,
Thread,
Author