Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: coloring the command-line?
- X-seq: zsh-users 12630
- From: "Aaron Davies" <aaron.davies@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: coloring the command-line?
- Date: Wed, 20 Feb 2008 12:04:55 -0500
- 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=HK//Bp//FUCDkJv6PCS6eb/gizLkfDVRv3CUgJdPC94=; b=XKlFAkN7bkfBivcl/cgRsy9wmS9Emut1EfwGB49JS3WyZ/ckhxSLdgS9f885wZSnP433EhfX357zSFyZRBdbnnhvxcq23vcR8YjCw+lFu/O3we3IbwAGS70QZQWNmaF78/q93GspikYgRUZWFK2rZ1ftyqv9FKPrAgXeL1DdO1E=
- 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=uMQrMqwYy33zJbtIxK41vJ7bgnQj5ki2r06aC7KRIn0Q/vAEvWx5Lbojgxlg15NbCGk0a/5pOXFbbpdOCA91mZGzwi81Iz3PWMX4s2u6GR+l+PDu/1xg5lfaUbG7qgWrcDrO2wtc9w8CdhwbTlxdcDhmDP/q4M5o7oMDEHcMsJM=
- In-reply-to: <237967ef0802191602r512478adrb5982c6f6628e5b4@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <c4e763ac0802191523y1617fa66r8c6475a32990a526@xxxxxxxxxxxxxx> <237967ef0802191602r512478adrb5982c6f6628e5b4@xxxxxxxxxxxxxx>
On Feb 19, 2008 7:02 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 20/02/2008, Aaron Davies <aaron.davies@xxxxxxxxx> wrote:
>
> > i'd like to have all the commands i type in (some) zsh shells appear
> > in a color other than regular gray
> >
> > at the moment, i'm doing this in PS1
> >
> > export PS1='^[[0;31m%# '
> >
> > and it works decently, but has the drawback of screwing up alignment
> > in some odd ways:
> >
> > if i use ^R to start a history search, the cursor jumps forward eight characters
> >
> > if i type off the end of the screen, it loops around to the beginning
> >
> > if i pull up a more-than-one-screen command with an up-arrow and start
> > backing up to edit an early part of it, the cursor jumps to the line
> > above
> >
> > etc.
> >
> > i assume there's a better state to leave the tty in that doesn't have
> > these side effects?
>
> Enclose the escape code with %{ and %} and it should work fine. Ie
> something like
> export PS1='%{\e[0;31m%}%# '
thanks, that did it!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author