gvm
gvm copied to clipboard
Overriden cd fails to switch to paths with spaces
When attempting to use the cd
command in bash, which runs $HOME/.gvm/scripts/env/cd
, to navigate to a directory with spaces in its name, the operation fails with the error message "bash: cd: too many arguments." The expected behavior is a successful navigation to directories with spaces in their names.
How to reproduce:
- With initialized GVM, create a directory with spaces in its name:
mkdir -p '~/foo bar'
cd '~/foo bar'
- The following error is encountered:
bash: cd: too many arguments
Environment:
- Operating System: GNU/Linux
- GVM Version: 1.0.22
- Bash Version: 5.1.16(1)-release
Faced the similar issue
Have the same issue
After install gvm my cd stopped to work, if run any cd something
and nothing happens.
To solve that for now I deleted $HOME/.gvm/scripts/env/cd
script to use the default linux cd.
That gvm cd script is really need?
The same issue
After install gvm my cd stopped to work, if run any
cd something
and nothing happens. To solve that for now I deleted$HOME/.gvm/scripts/env/cd
script to use the default linux cd. That gvm cd script is really need?
I tried to delete that but seems it broke the improt of the "cd" in gvm file, could you please also point out where the import of the cd is?
Thank you
EDIT: NVM, I delete the row in .gvm/scripts/gvm-default at last row and it solved by itself... (for now for my own bash)
This was totally unexpected and borks PATH in wsl 2 on windows as well.
See https://github.com/microsoft/WSL/issues/10399
I have this issue. I disabled the last command in the scripts/gvm-default
file:
. "$GVM_ROOT/scripts/env/cd" && cd .
When I inspected the code I noticed there's a cd
override function. That seems a bit dangerous to me! I'm on macOS but I'm using bash. I haven't tried with zsh but I suspect it's the same.
I have this issue. I disabled the last command in the
scripts/gvm-default
file:. "$GVM_ROOT/scripts/env/cd" && cd .
When I inspected the code I noticed there's a
cd
override function. That seems a bit dangerous to me! I'm on macOS but I'm using bash. I haven't tried with zsh but I suspect it's the same.
I had the cd
command no longer working, without any error
Thanks for your help, I did the same :)
Same for me.
If I manually edit ~/.gvm/scripts/env/cd
with the fixes from https://github.com/moovweb/gvm/pull/482 , the issue no longer happens, so I guess that the issue should be fixed as soon as that PR is merged
It looks like this repo hasn't seen any commits in almost a year, so manually applying my fix from #482 may be the only option :(