Open Michaelzhouisnotwhite opened 4 months ago
In Oh My Bash, cd
is configured to print the new path when it finds the destination directory in the current directory. To turn off this behavior, you can set an empty string to CDPATH
:
# bashrc (after source "$OSH"/oh-my-bash.sh)
CDPATH=
Or you can redirect the output of cd
in the above case:
echo $(cd "${SCRIPT_DIR}" >/dev/null; pwd)
reproduce
the command shows the script current path. However, in oh-my-bash, it shows the same path twice.
output
oh-my-bash:![image](https://github.com/ohmybash/oh-my-bash/assets/52443370/d1f3e242-c96d-4218-a56d-9b6012b27f0d)
origin shell:![image](https://github.com/ohmybash/oh-my-bash/assets/52443370/27f54d27-5c32-473b-9f66-9896c78f0df5)