From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12323 invoked from network); 4 Jul 2005 22:33:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jul 2005 22:33:47 -0000 Received: (qmail 35656 invoked from network); 4 Jul 2005 22:33:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jul 2005 22:33:38 -0000 Received: (qmail 12852 invoked by alias); 4 Jul 2005 22:33:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9027 Received: (qmail 12842 invoked from network); 4 Jul 2005 22:33:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Jul 2005 22:33:31 -0000 Received: (qmail 34684 invoked from network); 4 Jul 2005 22:33:31 -0000 Received: from viefep15-int.chello.at (213.46.255.19) by a.mx.sunsite.dk with SMTP; 4 Jul 2005 22:33:27 -0000 Received: from Dingo ([213.47.104.218]) by viefep15-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20050704223325.PJWU1955.viefep15-int.chello.at@Dingo> for ; Tue, 5 Jul 2005 00:33:25 +0200 From: Christian Taylor To: "zsh-users" Subject: Re: reinventing print_exit_value Date: Tue, 5 Jul 2005 00:32:27 +0200 User-Agent: KMail/1.8 References: <200507032356.17308.cht@chello.at> <1050704143242.ZM12445@candle.brasslantern.com> In-Reply-To: <1050704143242.ZM12445@candle.brasslantern.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200507050032.27125.cht@chello.at> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Bart Schaefer wrote: > On Jul 3, 11:56pm, Christian Taylor wrote: > } > } However: is there a simpler way to achieve this? My solution seems a bit > } inelegant to me. > > How about this way of putting it into the prompt? > > PS1="%{%(0?..$(echotc DO 1)$(echotc sc) > $(echotc rc)$(echotc UP 1))%}%# %{%(0?..$(echotc sc) > (%?%)$(echotc rc))%}" Thanks, I didn't know about echotc (and echoti), in fact it didn't occur to me that I could manipulate the cursor position directly. This has given me something new to play with :) Christian