Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: prompt expansion %l inconsistency



>
> 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