From owner-freebsd-questions@FreeBSD.ORG Sun May 13 13:25:18 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D721C106566C for ; Sun, 13 May 2012 13:25:18 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 975098FC1D for ; Sun, 13 May 2012 13:25:18 +0000 (UTC) Received: from r56.edvax.de (port-92-195-20-192.dynamic.qsc.de [92.195.20.192]) by mx02.qsc.de (Postfix) with ESMTP id 4E77927FC6; Sun, 13 May 2012 15:25:10 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q4DDP9NH003235; Sun, 13 May 2012 15:25:10 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 13 May 2012 15:25:09 +0200 From: Polytropon To: Jos Chrispijn Message-Id: <20120513152509.09dbfc10.freebsd@edvax.de> In-Reply-To: <4FAFAF7F.4010409@webrz.net> References: <4FAFAF7F.4010409@webrz.net> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: CSH prompt X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 13:25:18 -0000 On Sun, 13 May 2012 14:56:31 +0200, Jos Chrispijn wrote: > In cshell I use this prompt: set prompt = "%B[%@]%b %m[%/]> " > The problem I face now is that if I use this prompt with symbolic links, > the presented location is displaying the symbolic link rather than the > real directory name. > Is there a way of preventin this? Yes, a very ugly way which I just found out: alias precmd 'set WD=`pwd`; set prompt = "%B[%@]%b %m[$WD]> "' Example: [3:21pm] r56[/]> cd /sys [3:21pm] r56[/usr/src/sys]> _ It redefines the whole prompt at any command that could affect the current working directory (not only "cd" can do that). This is needed as any call to `pwd` stored into a variable will only affect $prompt once - this is when it's set, only at this time $WD would be evaluated. So that's why this strange command. :-) Oh, and I just improved it. How about this? alias precmd 'set prompt = "%B[%@]%b %m[`pwd`]> "' Much better. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...