From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20770 invoked from network); 6 Dec 1999 05:24:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Dec 1999 05:24:54 -0000 Received: (qmail 5331 invoked by alias); 6 Dec 1999 05:24:44 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2759 Received: (qmail 5324 invoked from network); 6 Dec 1999 05:24:43 -0000 Date: Sun, 5 Dec 1999 23:24:40 -0600 From: Dan Nelson To: zsh users Subject: Re: color prompt Message-ID: <19991205232440.A5712@dan.emsphone.com> References: <19991205180334.A25275@uiuc.edu> <19991206005148.B9247@thelonious.new.ox.ac.uk> <19991205221528.A25782@uiuc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <19991205221528.A25782@uiuc.edu>; from "Matt Garman" on Sun Dec 5 22:15:28 GMT 1999 X-OS: FreeBSD 4.0-CURRENT In the last episode (Dec 05), Matt Garman said: > In the mean time, I tried putting something like this in my ~/.zshrc file: > > fg_black="$(echo -n '\e[1;30m')" > fg_green="$(echo -n '\e[0;32m')" > fg_brown="$(echo -n '\e[0;33m')" > fg_grey="$(echo -n '\e[0;37m')" > PS1="${fg_black}[${fg_green}%W %T${fg_black}] \ > ${fg_brown}%m${fg_black}:${fg_brown}%l \ > ${fg_black}:${fg_brown}%~${fg_grey}%# " > > (that's all on one line) > > Which makes my prompt look exactly the way I want it. However, this > seems to disturb cursor positioning for doing completions with tab and > also browsing the command history with the arrow keys. Zsh expects that every character in PS1 will advance the cursor one space. Wrap any non-printing escape sequences in %{...%}, and it should work. So use %{$fg_black%}, etc. -- Dan Nelson dnelson@emsphone.com