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

Having starship in a directory with spaces (like /c/Program Files/) causes it to not show the prompt at all #6333

Open
emilio opened this issue Oct 19, 2024 · 0 comments · May be fixed by #6334
Labels
🐛 bug Something isn't working as expected.

Comments

@emilio
Copy link

emilio commented Oct 19, 2024

Current Behavior

zsh: no such file or directory: /c/Program
zsh: no such file or directory: /c/Program

Expected Behavior

My prompt :)

Possible Solution

starship init zsh outputs things like:

PROMPT='$(''/c/Program Files/starship/bin/starship.exe'' prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
RPROMPT='$(''/c/Program Files/starship/bin/starship.exe'' prompt --right --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
PROMPT2="$('/c/Program Files/starship/bin/starship.exe' prompt --continuation)"

Escaping the space like:

PROMPT='$(''/c/Program\ Files/starship/bin/starship.exe'' prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
RPROMPT='$(''/c/Program\ Files/starship/bin/starship.exe'' prompt --right --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
PROMPT2="$('/c/Program\ Files/starship/bin/starship.exe' prompt --continuation)"

Seems to work.

Environment

  • Starship version: 1.21.1
  • zsh version: zsh 5.9 (x86_64-pc-msys)
  • Operating system: Windows 10.0.26120
  • Terminal emulator: WezTerm 20240203-110809-5046fc22
  • Git Commit Hash: 47ccc36
  • Branch/Tag: master
  • Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15)
  • Rust channel: stable-x86_64-pc-windows-msvc release
  • Build Time: 2024-10-18 16:32:39 +00:00

Relevant Shell Configuration

eval "$(starship init zsh)"

Starship Configuration

N/A

@emilio emilio added the 🐛 bug Something isn't working as expected. label Oct 19, 2024
emilio added a commit to emilio/starship that referenced this issue Oct 19, 2024
emilio added a commit to emilio/starship that referenced this issue Oct 19, 2024
::STARSHIP:: is already properly quoted in init/mod.rs, so this seems to
work nicely.

Fixes starship#6333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant