From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 9 Dec 2004 16:46:25 -0800 From: Micah Stetson To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] 9term customization Message-ID: <20041210004625.GA19541@epaphras> References: <2814F26DA6908F41927A81C410C4991A02079BE5@siamun.server.bl.corp.intranet> <20041209182451.GB6041@epaphras> <2814F26DA6908F41927A81C410C4991A02079BE6@siamun.server.bl.corp.intranet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2814F26DA6908F41927A81C410C4991A02079BE6@siamun.server.bl.corp.intranet> User-Agent: Mutt/1.4.1i Topicbox-Message-UUID: 140e3fa4-eace-11e9-9e20-41e7f4b1d025 On Thu, Dec 09, 2004 at 04:46:38PM -0200, Gabriel Cosentino de Barros wrote: > > fn cd { builtin cd $1; prompt=(`{pwd}^'% ' ' ') } > > I don't quite understand that. > I tryied simply entering it into rcsh and it did nothing. Unlike in bash and such, $prompt doesn't get special evaluation whenever a prompt is displayed. There is no special support for dynamic prompt strings. Simply setting $prompt to a value including the current working directory will make it always display that value, irregardless of changes to the working directory. The above function definition uses the more general facilities of rc to get the job done without needing special backslash escapes and other such nonsense. We replace the 'cd' command with a version that first calls the original cd command and then sets the prompt with the new working directory. You shouldn't see the prompt change until after you run cd. > then i entered > just "prompt=(`{pwd}^'% ' ' ')" and then rcsh crashed. This should have made the prompt indicate which directory you ran that command in for the rest of the session. But 9pm is old and unmaintained, and I've seen it behave strangely and/or crash under some newer versions of Windows. You may be out of luck, unless you want to try to fix it. Micah