From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.dk
Cc: 266785-forwarded@bugs.debian.org, 266785-submitter@bugs.debian.org
Subject: [jjminar@fastmail.fm: Bug#266785: zsh: The elite2 prompt displays the tty incorrectly]
Date: Wed, 24 Nov 2004 00:01:13 -0500 [thread overview]
Message-ID: <20041124050113.GA17679@scowler.net> (raw)
I'm gonna commit this instead, as I don't have a position on the "/" to
"|" change.
Index: Functions/Prompts/prompt_elite2_setup
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Prompts/prompt_elite2_setup,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 prompt_elite2_setup
--- Functions/Prompts/prompt_elite2_setup 18 Nov 1999 15:15:27 -0000 1.1.1.3
+++ Functions/Prompts/prompt_elite2_setup 24 Nov 2004 04:55:33 -0000
@@ -25,13 +25,12 @@
: ${(P)varname=$(echo -n "\\0$code")}
done
- local tty=`tty|cut -d/ -f3`
local text="%{$fg_no_bold[$text_col]%}"
local parens="%{$fg_bold[$parens_col]%}"
local punctuation_color="%{$fg_bold[grey]%}"
local reset="%{$reset_color%}"
- PS1="$punctuation_colorÚ$textÄ$parens($text%n$punctuation_color@$text%m$parens)$textÄ$parens($text%!$punctuation_color/$text$tty$parens)$textÄ$parens($text%D{%I:%M%P}$punctuation_color:$text%D{%m/%d/%y}$parens)$textÄ$punctuation_color-$reset$prompt_newline$punctuation_colorÀ$textÄ$parens($text%#$punctuation_color:$text%~$parens)$textÄ$punctuation_color-$reset "
+ PS1="$punctuation_colorÚ$textÄ$parens($text%n$punctuation_color@$text%m$parens)$textÄ$parens($text%!$punctuation_color/$text%y$parens)$textÄ$parens($text%D{%I:%M%P}$punctuation_color:$text%D{%m/%d/%y}$parens)$textÄ$punctuation_color-$reset$prompt_newline$punctuation_colorÀ$textÄ$parens($text%#$punctuation_color:$text%~$parens)$textÄ$punctuation_color-$reset "
PS2="$parensÄ$textÄ$punctuation_color-$reset "
----- Forwarded message from Jan Minar <jjminar@fastmail.fm> -----
Date: Thu, 19 Aug 2004 07:32:37 +0200
From: Jan Minar <jjminar@fastmail.fm>
To: Debian Bug Tracking System <maintonly@bugs.debian.org>
Subject: Bug#266785: zsh: The elite2 prompt displays the tty incorrectly
Package: zsh
Version: 4.0.4-33
Severity: minor
Tags: patch
The elite2 prompt is incorrect -- the tty bit is OK for /dev/*, but it
fails with /dev/*/* (devpts, i.e. all X terminals a.o.). I see no
difference between using cut(1) and %y. I also changed the delimiter,
so it plays more nicely with the fact the dashes are now part of the tty
name.
The incorrect prompt:
(jan@kontryhel)(31337/pts)(05:15am:08/19/04)-
^^^
The guilty line:
local tty=`tty|cut -d/ -f3`
^^^ should read -f3-
The corrected prompt:
(jan@kontryhel)(31337|pts/1)(05:15am:08/19/04)-
^ ^^
The patch:
--- /usr/share/zsh/4.0.4/functions/Prompts/prompt_elite2_setup.ORIG Sat Jun 12 02:35:53 2004
+++ /usr/share/zsh/4.0.4/functions/Prompts/prompt_elite2_setup Sat Jun 12 02:38:52 2004
@@ -25,13 +25,13 @@
: ${(P)varname=$(echo -n "\\0$code")}
done
- local tty=`tty|cut -d/ -f3`
+ local tty=%y
local text="%{$fg_no_bold[$text_col]%}"
local parens="%{$fg_bold[$parens_col]%}"
local punctuation_color="%{$fg_bold[grey]%}"
local reset="%{$reset_color%}"
- PS1="$punctuation_colorÚ$textÄ$parens($text%n$punctuation_color@$text%m$parens)$textÄ$parens($text%!$punctuation_color/$text$tty$parens)$textÄ$parens($text%D{%I:%M%P}$punctuation_color:$text%D{%m/%d/%y}$parens)$textÄ$punctuation_color-$reset$prompt_newline$punctuation_colorŔ$textÄ$parens($text%#$punctuation_color:$text%~$parens)$textÄ$punctuation_color-$reset "
+ PS1="$punctuation_colorÚ$textÄ$parens($text%n$punctuation_color@$text%m$parens)$textÄ$parens($text%!$punctuation_color|$text$tty$parens)$textÄ$parens($text%D{%I:%M%P}$punctuation_color:$text%D{%m/%d/%y}$parens)$textÄ$punctuation_color-$reset$prompt_newline$punctuation_colorŔ$textÄ$parens($text%#$punctuation_color:$text%~$parens)$textÄ$punctuation_color-$reset "
PS2="$parensÄ$textÄ$punctuation_color-$reset "
Cheers,
Jan.
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux kontryhel 2.4.27-jan #2 Tue Aug 17 11:10:35 CEST 2004 i686
Locale: LANG=C, LC_CTYPE=cs_CZ.ISO-8859-2
Versions of packages zsh depends on:
ii libc6 2.2.5-11.5 GNU C Library: Shared libraries an
ii libcap1 1:1.10-12 support for getting/setting POSIX.
ii libncurses5 5.2.20020112a-7 Shared libraries for terminal hand
--
"To me, clowns aren't funny. In fact, they're kind of scary. I've wondered
where this started and I think it goes back to the time I went to the circus,
and a clown killed my dad."
----- End forwarded message -----
reply other threads:[~2004-11-24 5:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041124050113.GA17679@scowler.net \
--to=schizo@debian.org \
--cc=266785-forwarded@bugs.debian.org \
--cc=266785-submitter@bugs.debian.org \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).