Skip to content

Fix) Have builtin cd to handle spaces in folder name#531

Open
exxocism wants to merge 2 commits into
moovweb:masterfrom
exxocism:fix/cd_sux
Open

Fix) Have builtin cd to handle spaces in folder name#531
exxocism wants to merge 2 commits into
moovweb:masterfrom
exxocism:fix/cd_sux

Conversation

@exxocism
Copy link
Copy Markdown

Project issue/Description

  • Vibe coded to have builtin cd to handle spaces in folder name
    Fix shell word-splitting issues when working with directories containing spaces (e.g., Program Files)
    Quote all variable expansions in find_local_pkgset that may contain paths with spaces
    Fix cd function override to preserve argument boundaries using "$@" instead of unquoted $*
    

Major changes

  • Have builtin cd to handle extra spaces: 78ca74b
  • Have find_local_pkgset to handle extra spaces: 246b5a9

Minor changes

  • None

Test env

  • Open a new terminal or re-source your shell config
  • Navigate to a directory with spaces in the name: cd "Program Files"
  • Verify no "too many arguments" or syntax errors occur
  • Verify GVM's auto-switching of Go versions still works when changing directories

@darkweaver87
Copy link
Copy Markdown

darkweaver87 commented Apr 28, 2026

Confirming this bug on Debian (Linux 6.18, bash 5.x) with gvm installed via the official installer.

Even with single, double or backslash-escaped quotes, the unquoted $* inside the cd() override re-splits the path on whitespace before passing it to __gvm_oldcd.

Applied this PR's diff manually to scripts/env/cd and scripts/function/find_local_pkgset, re-sourced gvm, and cd into directories with spaces now works as expected. Go version auto-switching still works.

Thanks @exxocism 👍 for merge.

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 this pull request may close these issues.

2 participants