Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Prompt coloring question
- X-seq: zsh-users 13023
- From: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>
- To: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>, "Zsh Users" <zsh-users@xxxxxxxxxx>
- Subject: Re: Prompt coloring question
- Date: Sun, 13 Jul 2008 15:37:42 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Hg7CaGIImB7r38lqyols/uctQra+kITUCBrlJkAvQ28=; b=ubp1nDVUWYeBqYji37o6hw4DZHS/pqUNXaU8IMCeEwIX8CiE9DfC/jv/JwaufEGgch okkPvf299vyCnTLxLApuGWyfsnebq3stQc24zOZAtGgRGZNtX2qTATnY+QgPIi28c+Pl 1R4n1vJow9jcUCXWhYg6lF13gl6LDXrULBWXs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=qUqxN0RlvY0DSHAtLx7lZybpbFsWFi7p4HUn36CXEQzoWrv6+yJrDKxUTYZ0GzV1yo qLLwMdpP3TgglLBrUIp96KYgZU2F6zeaO83lytBMvxBwU7E3vYN4OobcgP3vuGbt2dj+ NoifzSWe4/qE9ETWhwy0Lqq1sDhqz1iK+YEek=
- In-reply-to: <20080713022342.GA51466@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2d460de70807121443s1affa065n5451a763a4e70374@xxxxxxxxxxxxxx> <20080713022342.GA51466@xxxxxxxxxxxxxxxxxxxx>
On Sun, Jul 13, 2008 at 04:23, Phil Pennock
<zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> Define invert? The sequence you provide is a reset to default and
> normal red text, so you'll need to be clearer about what you want and
> what you tried, instead of what you started from.
I want to use %S and %s to invert the user name so I know I am on a
remote system. While I can easily invert other colors, like light green
( $'%{\e[1;32m%}' ), I can't invert red.
> In my terminal (not the same as what you're using):
> "negative image + red display", $'%{\e[7;31m%}' works for me.
> "red background", $'%{\e[0;41m%}' works for me.
I want to dynamically switch back and forth based on if I am using
SSH to keep an already cluttered prompt setting at least a bit
readable. In case anyone is interested & wants to steal (it is even
girlfriend-compatible(!)):
[ $SSH_TTY ] && ZSHRC_PARENT_SSH=1
[ $WINDOW ] && ZSHRC_PARENT_SCREEN=1
PROMPT=''
[ $ZSHRC_PARENT_SSH ] && PROMPT+="%S"
[ $USER = 'ilona' ] &&
PROMPT+="%(!.$fg_red%m.$fg_light_purple%n@%m)$fg_no_colour" ||
PROMPT+="%(!.$fg_red%m.$fg_light_green%n@%m)$fg_no_colour"
[ $ZSHRC_PARENT_SSH ] && PROMPT+="%s"
[ $ZSHRC_PARENT_SCREEN ] && PROMPT+="$fg_light_yellow [$WINDOW]"
PROMPT+="$fg_light_blue %~ %# $fg_no_colour"
Thinking about it, this might be a good time to switch to the 'new'
colour handling stuff zsh offers..
Richard
Messages sorted by:
Reverse Date,
Date,
Thread,
Author