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

Re: zsh AUTO_CD proposal



On Mar 16,  1:54pm, Dave Yost wrote:
} 
} The definition of
}      setopt AUTO_CD
} should be changed

No, it shouldn't.

We could add a user-level command-not-found handler, perhaps, but not
change AUTO_CD.

} If a command is issued that can't be executed as a normal command, 
} and the command is the name of a directory, then instead execute
}     dirCommand dir

Let's try to avoid camelCapsNames in zsh, please.  All other such
names have hyphens or underscores between words.

} Personally, I would redefine this function to call a function that 
} does a pushd.

Not sufficient simply to do this?

	setopt AUTO_PUSHD
	cd chdir () {
	  setopt localoptions NO_AUTO_PUSHD
	  builtin cd "$@"
	}

This accomplishes what you describe, in all versions of zsh that support
local options.  Or maybe you just want AUTO_PUSHD set all the time and
don't care about redefining "cd" to avoid it?



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