about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrey Borzenkov <bor@users.sourceforge.net>2001-06-22 09:44:06 +0000
committerAndrey Borzenkov <bor@users.sourceforge.net>2001-06-22 09:44:06 +0000
commit791e11a084882f69e1e7373c80024d3f78b10baa (patch)
tree2abcec3b1cfa9548009738730c7d0be0a7c48c16
parent551b5d149923b290d6f7d2cb1408d40c0e1fc2a8 (diff)
downloadzsh-791e11a084882f69e1e7373c80024d3f78b10baa.tar.gz
zsh-791e11a084882f69e1e7373c80024d3f78b10baa.tar.xz
zsh-791e11a084882f69e1e7373c80024d3f78b10baa.zip
15021: new %y character; %l semantic back
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/prompt.yo7
-rw-r--r--Src/prompt.c8
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);