Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug with chpwd/allexport



Dominik Vogt <dominik_vogt@xxxxxx> typed:
:# export PS1='%~>'
:~ > setopt ALLEXPORT
:~ > setopt AUTONAMEDIRS
:~ > function chpwd () {
:> FOO=$PWD
:> echo $FOO
:> }
:~ > cd /etc
:/etc
:$FOO >
 ^^^^ You mean "~FOO >"

:There is a simple workaround:
:function chpwd () {
:     setopt LOCALOPTIONS
:     unsetopt AUTONAMEDIRS
:     unsetopt ALLEXPORT
:     FOO=$PWD
:     echo $FOO
:}

Simple workaround 1:
    chpwd () {
	echo $PWD
    }

Simple workaround 2 (in case we're only seeing a fragment of your chpwd() ):
    chpwd() {
	local FOO=$PWD
	echo $FOO
    }

BTW, do you have a good reason for setopt'ing ALL_EXPORT?  Why polute your
environment in that manner?
-- 
Geoff Wing   <gcw@xxxxxxxxx>            Mobile : 0412 162 441
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/



Messages sorted by: Reverse Date, Date, Thread, Author