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

cd command auto-completion with spaces in path #4630

Closed
wiebecommajonas opened this issue Nov 7, 2022 · 1 comment · Fixed by #4632
Closed

cd command auto-completion with spaces in path #4630

wiebecommajonas opened this issue Nov 7, 2022 · 1 comment · Fixed by #4632
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@wiebecommajonas
Copy link

Summary

The :cd command seems to be tripped up by spaces in the path. The auto-completion stops working and the current behavior should be changed. Auto-completed directories should be pasted either with escaped spaces or with " surrounding the whole path. I do not know if this affects other commands.

Reproduction Steps

I tried this:

mkdir a\ b
hx .

Inside hx:
:cd a<tab> works and shows directory a b.
Selecting this pastes :cd a b into the command line.

I expected this to happen:

I expected the command to read :cd a\ b or :cd "a b" after selecting the auto-completion item.

Instead, this happened:

I got the error pasted in the log section below.

Additionally the auto completion stops working after I encounter a directory containing a space (even when I type it manually with \ for spaces).

Helix log

~/.cache/helix/helix.log
2022-11-07T15:58:24.206 helix_view::editor [ERROR] editor error: Couldn't change the current working directory: No such file or directory (os error 2)

Platform

macOS

Terminal Emulator

iTerm2

Helix Version

helix 22.08.1 (f41f28b)

@wiebecommajonas wiebecommajonas added the C-bug Category: This is a bug label Nov 7, 2022
@the-mikedavis
Copy link
Member

Mostly a duplicate of #4266. Also see #4316, #4587.

There's a remaining edge-case where :cd a\<tab> produces an incorrect result. I have some local changes that fix this that I'll push.

@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label Nov 7, 2022
@the-mikedavis the-mikedavis linked a pull request Nov 7, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants