[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pwd on prompt



>From: joost@rulcmc.leidenuniv.nl (joost witteveen)
>Date: 	Fri, 15 Nov 1996 15:15:09 -0500

>I never ever used es, and didn't even know I was on this list.

I find it odd that you would be on a list for es, if you don't use it.
Whatever... :-)

>> but I' have the pwd on the prompt as it is the case
>> with tcsh, ksh and bash.

>Yeah, I like that, too. I managed to do this with:

>prompt=`{pwd}

>However, this doesn't give me a space between the prompt and the
>command, I'll have to experiment a bit more.

This solution is static.  That is to say that the prompt will not
change when the currect directory changes.

I suggest something based on one of the following:

let (o = $fn-%prompt) { fn %prompt {prompt = `{pwd}^' '; $o}}
let (o = $fn-cd) { fn cd {$o $*; prompt = `{pwd}^' '}}

The first solution will rerun the binding to prompt before each
display at the expense of a minor amount of extra delay.  The second
solution will only rerun the binding after 'cd' changes it.  The
problem with the second approach is that it will not work in any case
where es program fragments have a let binding to the original 'cd'.

>Anyway, I agree with you that es is quite nice!

I sometimes wonder why more people don't use it.

Regards,
Loren

-- 
Loren J. Rittle (rittle@comm.mot.com)	PGP KeyIDs: 1024/B98B3249 2048/ADCE34A5
Systems Technology Research (IL02/2240)	FP1024:6810D8AB3029874DD7065BC52067EAFD
Motorola, Inc.				FP2048:FDC0292446937F2A240BC07D42763672
(847) 576-7794				Call for verification of fingerprints.