Hi,

I've noticed that Bash's native filename completion can produce an unusable
cd command when a directory name begins with a hyphen.

For example, given a directory named -example, typing cd -ex and pressing
Tab produces:

cd -example/

Executing it fails because cd interprets the directory name as an option.

The expected behavior would be something like:

cd ./-example/

I've reproduced this with programmable completion disabled (shopt -u
progcomp), so it doesn't appear to be specific to bash-completion or fzf.

I understand that filename completion is generally command-agnostic, but it
seems undesirable for completion to generate a command that predictably
fails.

Is this considered intentional behavior, or would a patch addressing it be
welcome?

Thanks!

Diin

Reply via email to