From: Miek Gieben <miekg@atoom.net>
To: zsh users <zsh-users@sunsite.dk>
Subject: previous cmd in RPS1
Date: Fri, 26 Aug 2005 11:36:37 +0200 [thread overview]
Message-ID: <20050826093637.GA15060@atoom.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]
hello all,
I have my prompt setup in such a way that it will print my previous
cmd in green (when the exitcode was 0) or red (exitcode != 0) on the
right side of my screen. This works really well, expect in some cases.
It seems that sometimes this setup fails, for instance when my
previous cmd had a % in it, this gets re-evaluated and results in
a weird looking prompt. Also when I try to type in a for-loop and I
make a typo which causes the loop to hang, my prompt also hangs.
It there any way to make zsh /not/ to parse my previous cmd but
just show it as is?
Below are the relevant piecies of my prompt setup:
RPSL=$'%{\e[0m%}%{\e[$C;31m%}%(0?.%{\e[$C;32m%}.(%?%)) '
RPSR=$'%{\e[0m%}'
((MAXMID=$COLUMNS / 2)) # truncate to this value
RPSMID=$history[$[${(%):-%h}-1]]
RPS1="$RPSL%$MAXMID<... <$RPSMID$RPSR"
Thanks for any help,
--
grtz,
- Miek
http://www.miek.nl http://www.nlnetlabs.nl
PGP Key ID: 0xB18453A1
fingerprint: 002B B079 0DDA 7D44 2B5C CAB0 C3B7 F943 B184 53A1
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2005-08-26 9:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-26 9:36 Miek Gieben [this message]
2005-08-26 16:18 ` Bart Schaefer
2005-08-26 16:30 ` Miek Gieben
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=20050826093637.GA15060@atoom.net \
--to=miekg@atoom.net \
--cc=zsh-users@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).