On Jan 2, 2008 2:13 PM, Isaac Dupree <[EMAIL PROTECTED]> wrote: > in fact there are two confusing things, though I figured them out > eventually, that perhaps fish could be more helpful about > > 1. when '.' is not *first in CDPATH*, 'cd ..' doesn't work as expected > -- it cd's from whatever the first thing in CDPATH is.
Hmm, this is a bit of a misfeature, I'll admit. Will fix. > And CDPATH seems > to be treated as a universal variable even though I didn't tell fish to > do this, so, even though I commented out setting CDPATH in > .config/fish/config.fish, and opened a new terminal window, 'cd' still > behaved very oddly. The default fish init scripts create a universal CDPAth variable for you. CDPATH is not treated differently than any other variables. If you want to remove it, type 'set -e CDPATH' and you should be all set. I've updated the documentation to mention this. > Eventually I remembered universal variables and > checked 'echo $CDPATH' (why??), 'type CDPATH'(didn't work), `set -U` and > look through the list for CDPATH, and I found it, so then I did `set > CDPATH .` and it was fixed. > I'm not sure what the '(why?)' referrs to. You obviously feel something is done badly. Could you explain? > 2. So, I guess changes in current directory performed by the config-file > don't affect the resultant shell. I was doubly surprised since fish > documentation is quite clear about NOT having subshells, and in fact > normal sourcing in fish -- `. testscript` where testscript consists of > `cd /usr` -- does change the current directory, as expected from other > shells as well as fish doc. Furthermore, fish did not report any > warning/error message about 'cd' in the config-file, it just failed to > change the resultant shell's current directory, making me wonder if I > had got the right name of the config-file (since it didn't exist > already). Luckily I was wily enough to put an `echo` in the config-file > to test that it was being loaded; in fact putting > > cd /usr > echo $PWD > > makes it quite clear that cd is locally effective in the config-file. > (although `set -l` in the config-file only outputs argv -- it's not > exactly local. `set -g` there shows `PWD /Users/me/HOME/.config/fish` > among others, which is telling... ) However, putting `set -g MYVARIABLE > foof` in the config-file allows me to `echo $MYVARIABLE` in the > resultant interactive shell and get `foof`! Now, diabolically trying > `set -g PWD /usr` in config-file actually gives an error message: > set: Tried to change the read-only variable "PWD" > But that was to be expected? Hmm, actually, doing `PWD=/usr` in > interactive bash, changes the current directory to /usr (a behavior I > I'm quite happy not to see in fish, I think). Heh. If you start fish from the commandline in a specific directory, you want to remain in that directory after startup. This conflicts with the assumptions some people have when writing startup scripts that the cwd is ~. Fish solves this by cd:ind to ~, calling the startup scripts and the cd back to wherever cwd was before the startup scripts. This unfortunatly makes your rather sane and reasonable expectations fail. Perhaps it would be a better tradeof to never change the cwd and let broken startup scripts fail? > > > btw. I love the prompt string that abbreviates previous directories to > one character. It fits very well with my obsession with making fast > tab-completion to navigate my home directories. > :-) Axel > > Isaac > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Fish-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fish-users > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
