mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 00:51:05 +02:00
15021: new %y character; %l semantic back
This commit is contained in:
parent
551b5d1499
commit
791e11a084
3 changed files with 17 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
2001-06-22 Andrej Borsenkow <bor@zsh.org>
|
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.
|
* 15038: Test/A01grammar.ztst: test case for 15023.
|
||||||
(unposted) fix a couple of typos in test decriptions
|
(unposted) fix a couple of typos in test decriptions
|
||||||
|
|
||||||
|
|
|
@ -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.
|
(24/12 hour clock) in the same way.
|
||||||
)
|
)
|
||||||
item(tt(%l))(
|
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(%?))(
|
item(tt(%?))(
|
||||||
The return code of the last command executed just before the prompt.
|
The return code of the last command executed just before the prompt.
|
||||||
|
|
|
@ -514,6 +514,14 @@ putpromptchar(int doprint, int endchar)
|
||||||
stradd(get_username());
|
stradd(get_username());
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
|
if (*ttystrname) {
|
||||||
|
ss = (strncmp(ttystrname, "/dev/tty", 8) ?
|
||||||
|
ttystrname + 5 : ttystrname + 8);
|
||||||
|
stradd(ss);
|
||||||
|
} else
|
||||||
|
stradd("()");
|
||||||
|
break;
|
||||||
|
case 'y':
|
||||||
if (*ttystrname) {
|
if (*ttystrname) {
|
||||||
ss = (strncmp(ttystrname, "/dev/", 5) ?
|
ss = (strncmp(ttystrname, "/dev/", 5) ?
|
||||||
ttystrname : ttystrname + 5);
|
ttystrname : ttystrname + 5);
|
||||||
|
|
Loading…
Reference in a new issue