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
Fix fish completion when commandline contains multiple commands (#9727)
This changes some of the options passed to "complete", see also
https://fishshell.com/docs/current/cmds/complete.html
The flag --current-process means to only include tokens of the current command,
as delimited by shell metacharacters like ;, & and |, and newlines.
This fixes completion of a command line like
"python && pip <TAB>". Previously we'd run "eval python" (!)
Also, avoid using "eval" if possible since it's usually not necessary in
fish 3.0.0 and later.
Flag --cut-at-cursor means to only include tokens left of the cursor.
It's extremely unusual in fish that completions use anything right of the
cursor to complete. I didn't check pip sources but I doubt it's an exception.
I also used --cut-at-cursor for the current token because it potentially
offers more completions, and fish will filter them anyway.
for example, now it's possible to get completions on a commandline like
pip uninstall urllb3
^ cursor is here, so "commmandline -tc" is "url"
This correctly completes to "urllib3", because fish uses fuzzy matching ;)
0 commit comments