Skip to content

cd command auto-completion with spaces in path #4630

@wiebecommajonas

Description

@wiebecommajonas

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helix-termArea: Helix term improvementsC-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions