I'm having trouble with a basic behavior of cd
in fish
shell.
cd
to relative directory I'm willing to change directory using a relative path without the ./
. The directory exists:
❯ ls
addons/ custom-addons/ docker-compose.yml
The directory is auto-completed, yet I can't change to it:
❯ cd addons/
cd: The directory “addons/” does not exist
CDPATH
set -gx CDPATH $CDPATH $HOME/projects
As described in the documentation section Special Variables :
CDPATH
, an array of directories in which to search for the new directory for the cd builtin. By default, the fish configuration definesCDPATH
to be a universal variable with the values.
and~
.
I was overriding the default value while omitting .
and ~
value.
Adding them back solved the issue, in ~/.config/fish/config.fish
:
set -gx CDPATH $CDPATH . ~ $HOME/projects
Then reload fish
with:
exec fish
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.