Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriden cd fails to switch to paths with spaces #457

Open
paulourio opened this issue Dec 9, 2023 · 11 comments · May be fixed by #474 or #475
Open

Overriden cd fails to switch to paths with spaces #457

paulourio opened this issue Dec 9, 2023 · 11 comments · May be fixed by #474 or #475

Comments

@paulourio
Copy link

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:

  1. With initialized GVM, create a directory with spaces in its name:
mkdir -p '~/foo bar'
cd '~/foo bar'
  1. 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
@haha4github
Copy link

Faced the similar issue

@cmodk
Copy link

cmodk commented Dec 26, 2023

Have the same issue

@albertosouza
Copy link

albertosouza commented Jan 22, 2024

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?

@M4n5ter
Copy link

M4n5ter commented Jan 31, 2024

The same issue

SLN178716 added a commit to SLN178716/gvm that referenced this issue Feb 6, 2024
fholzer added a commit to fholzer/gvm that referenced this issue Apr 6, 2024
@fholzer fholzer linked a pull request Apr 6, 2024 that will close this issue
@padiakalpesh padiakalpesh linked a pull request Apr 11, 2024 that will close this issue
@benyaminl
Copy link

benyaminl commented Apr 24, 2024

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)

@joes
Copy link

joes commented May 6, 2024

This was totally unexpected and borks PATH in wsl 2 on windows as well.

See microsoft/WSL#10399

@matthewblott
Copy link

matthewblott commented May 29, 2024

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.

@jbdemonte
Copy link

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 :)

@palonsoro
Copy link

Same for me.

@palonsoro
Copy link

palonsoro commented Jul 20, 2024

If I manually edit ~/.gvm/scripts/env/cd with the fixes from #482 , the issue no longer happens, so I guess that the issue should be fixed as soon as that PR is merged

@yithian
Copy link

yithian commented Jul 22, 2024

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 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.