From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14494 invoked from network); 9 May 2008 13:07:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 May 2008 13:07:54 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 44588 invoked from network); 9 May 2008 13:07:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 May 2008 13:07:50 -0000 Received: (qmail 18588 invoked by alias); 9 May 2008 13:07:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24983 Received: (qmail 18574 invoked from network); 9 May 2008 13:07:47 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 9 May 2008 13:07:47 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id 819E680ED172 for ; Fri, 9 May 2008 15:07:43 +0200 (CEST) Received: from rly38d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly38d.srv.mailcontrol.com (MailControl) with ESMTP id m49D7gWE005479 for ; Fri, 9 May 2008 14:07:42 +0100 Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly38d.srv.mailcontrol.com (MailControl) id m49D6nxV004978 for zsh-workers@sunsite.dk; Fri, 9 May 2008 14:06:49 +0100 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly38d-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id m49D6hun004429; Fri, 09 May 2008 14:06:49 +0100 (BST) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 May 2008 14:06:41 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m49D6fRC000415; Fri, 9 May 2008 14:06:41 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m49D6fcj000412; Fri, 9 May 2008 14:06:41 +0100 Message-Id: <200805091306.m49D6fcj000412@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Renato Botelho" cc: zsh-workers@sunsite.dk Subject: Re: Completion damaging prompt In-reply-to: <747dc8f30805090551j3d26f810ud868028403ab8d9f@mail.gmail.com> References: <747dc8f30805090551j3d26f810ud868028403ab8d9f@mail.gmail.com> Comments: In-reply-to "Renato Botelho" message dated "Fri, 09 May 2008 09:51:20 -0300." Date: Fri, 09 May 2008 14:06:41 +0100 From: Peter Stephenson X-OriginalArrivalTime: 09 May 2008 13:06:41.0193 (UTC) FILETIME=[85DAF990:01C8B1D5] X-Scanned-By: MailControl A-08-50-00 (www.mailcontrol.com) on 10.68.1.148 X-Virus-Scanned: ClamAV 0.91.2/7079/Fri May 9 13:10:35 2008 on bifrost X-Virus-Status: Clean "Renato Botelho" wrote: > I'm using zsh 4.3.6 at FreeBSD 7.0, and I noted a problem with prompt > in some cases, > following is an example > > garga@botelhor:~> sudo su > > root@botelhor:/home/garga# > > root@botelhor:/home/garga# pkg >.. > And if I clear the screen using ^L prompt changes to ~garga > > root@botelhor:~garga# That means something, somewhere in shell code is referring to your home directory as ~garga (which would expand to /home/garga). After that's happened once it's treated as a candidate for abbreviation wherever name directories are valid. You have various choices: - If you want to track down what it is, you'll probably need to get the completion system to output debug information with "^X?". This could be time-consuming to get completely to the bottom of. - If you always want directories to be shown in full, you can replace %~ in your path with %/. That will show /home/garga instead of ~ when you're not root, however. - If you want the prompt to be abbreviated only when you're not root, you can change it to PROMPT='%n@%B%m%b:%(#.%/#.%~>) ' - If you're happy with your home directory always being abbreviated when you're root, so that at least it doesn't change, you can put a reference to it in the initialisation file: : ~garga -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070