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

Completions that contain single quotes are broken in zsh #475

Open
Jasper-M opened this issue May 15, 2023 · 1 comment
Open

Completions that contain single quotes are broken in zsh #475

Jasper-M opened this issue May 15, 2023 · 1 comment

Comments

@Jasper-M
Copy link

$ scala-cli e
(eval):5: unmatched '
(eval):5: unmatched '
(eval):5: unmatched '

The problem seems to be with those escaped ' characters:

$ scala-cli complete zsh-v1 "1" "e"
local -a args306746944
args306746944=(
'export:The \'export\' sub-command is experimental.'
)
_describe command args306746944

Without the backslashes the completions work, but the quotes simply aren't printed. I'm not sure if there's any way to output single quotes succesfully...

@Jasper-M
Copy link
Author

Jasper-M commented May 15, 2023

This seems to be a problem for arguments only. Not for options (args that start with -). For some reason options are put between double quotes and there the \' doesn't cause issues:

$ scala-cli complete zsh-v1 2 scala-cli --java-prop-o
local -a args1160121317
args1160121317=(
"--java-prop-option:Add java properties. Note that options equal \`-Dproperty=value\` are assumed to be java properties and don\'t require to be passed after \`--java-prop\`."
"--java-prop-option:Add java properties. Note that options equal \`-Dproperty=value\` are assumed to be java properties and don\'t require to be passed after \`--java-prop\`."
)
_describe command args1160121317

Notice the don\'t .

So I guess the fix may be as simple as always using double quotes. But then I don't know why options and arguments were handled differently to begin with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant