You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem here is that in __fish_complete_subcommand, we get the raw commandline contents via set -l cmd (commandline -cop) (commandline -ct) and then hand that off to complete -C. The raw commandline contents includes a backslash, so complete -C sees a backslash.
I'm still not sure why complete -C produces output though.
This is tricky - we have to rationalize whether the input to complete is escaped or unescaped, and whether its output is escaped. I would guess that the most common input to complete comes from commandline, where the user provides escaped data (e.g. includes backslashes). The output needs to be raw, i.e. no backslashes. So I think that builtin_complete needs to have a call to unescape().
There's potentially other functions (most likely fish functions) that work around this bug by attempting to unescape; we may now be unescaping twice. I guess we have to try it and find out.
Activity
ridiculousfish commentedon Nov 17, 2013
Reproduces for me. Good find.
ridiculousfish commentedon Feb 4, 2014
The problem here is that in __fish_complete_subcommand, we get the raw commandline contents via
set -l cmd (commandline -cop) (commandline -ct)and then hand that off tocomplete -C. The raw commandline contents includes a backslash, socomplete -Csees a backslash.I'm still not sure why complete -C produces output though.
ridiculousfish commentedon Feb 4, 2014
This is tricky - we have to rationalize whether the input to
completeis escaped or unescaped, and whether its output is escaped. I would guess that the most common input tocompletecomes fromcommandline, where the user provides escaped data (e.g. includes backslashes). The output needs to be raw, i.e. no backslashes. So I think thatbuiltin_completeneeds to have a call to unescape().There's potentially other functions (most likely fish functions) that work around this bug by attempting to unescape; we may now be unescaping twice. I guess we have to try it and find out.
ridiculousfish commentedon Feb 4, 2014
Thanks for reporting this!
tclementdev commentedon Feb 5, 2014
Thanks for fixing it :)