From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28768 invoked from network); 21 Jun 2001 09:46:43 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jun 2001 09:46:43 -0000 Received: (qmail 2186 invoked by alias); 21 Jun 2001 09:45:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15021 Received: (qmail 2166 invoked from network); 21 Jun 2001 09:45:55 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) From: "Andrej Borsenkow" To: "Zsh Workers" Subject: PATCH: %y modifier in prompt substitution RE: %l prompt expansion change Date: Thu, 21 Jun 2001 13:46:20 +0400 Message-ID: <002801c0fa37$063a8e60$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal > > One solution might be to restore the old %l behavior and put the new, > consistent tty-output behavior onto a new expansion, like %y, perhaps. > I hope this suites everybody ... -andrej BTW the list of characters in prompt subst manual is hopelessly out of order. Index: Src/prompt.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v retrieving revision 1.6 diff -u -r1.6 prompt.c --- Src/prompt.c 2001/06/06 16:38:50 1.6 +++ Src/prompt.c 2001/06/21 09:45:33 @@ -515,6 +515,14 @@ 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); Index: Doc/Zsh/prompt.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/prompt.yo,v retrieving revision 1.3 diff -u -r1.3 prompt.yo --- Doc/Zsh/prompt.yo 2000/07/13 11:20:46 1.3 +++ Doc/Zsh/prompt.yo 2001/06/21 09:45:34 @@ -120,7 +120,12 @@ (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.