symfony-console-completion icon indicating copy to clipboard operation
symfony-console-completion copied to clipboard

Tilde in program path interpreted literally when using `--multiple`

Open stecman opened this issue 9 years ago • 1 comments

The multiple option uses $1 instead of a fixed path for the completion program. When trying to complete for a program in the home directory using a path starting with ~/, the program path is interpreted as containing a literal tilde character, instead of expanding to $HOME.

This:

RESULT="$($1 _completion)";

resolves to effectively:

RESULT="$('~/bin/beam' _completion)";

which results in an error:

$ ~/bin/beam [tab]
-bash: ~/bin/beam: No such file or directory

instead of the expected behaviour:

RESULT="$("$HOME/bin/beam" _completion)";

Once this is resolved, multiple could be on by default too I think.

Tested using Bash 4.3 and 3.2.on OSX.

stecman avatar Sep 18 '16 23:09 stecman

Replacing ~ with ${HOME} in app path used in RESULT variable in hook code sounds like a plan.

aik099 avatar Sep 19 '16 06:09 aik099