diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Doc/Zsh/prompt.yo | 7 | ||||
-rw-r--r-- | Src/prompt.c | 8 |
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 3ffd99172..4db9eebac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-06-22 Andrej Borsenkow <bor@zsh.org> + * 15021: Src/prompt.c, Doc/Zsh/prompt.yo: revert to old %l + semantic; add new %y character instead as suggested by Wayne + * 15038: Test/A01grammar.ztst: test case for 15023. (unposted) fix a couple of typos in test decriptions diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo index e486b29c4..80fd736c3 100644 --- a/Doc/Zsh/prompt.yo +++ b/Doc/Zsh/prompt.yo @@ -120,7 +120,12 @@ tt(%K)/tt(%L) correspond to tt(%k)/tt(%l) for the hour of the day (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. diff --git a/Src/prompt.c b/Src/prompt.c index 47c8af797..d5df9d1ce 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -515,6 +515,14 @@ putpromptchar(int doprint, int endchar) 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); |