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

Pass all of $argv to pk-command-not-found #8579

Closed
septatrix opened this issue Dec 23, 2021 · 1 comment · Fixed by #8591
Closed

Pass all of $argv to pk-command-not-found #8579

septatrix opened this issue Dec 23, 2021 · 1 comment · Fixed by #8591

Comments

@septatrix
Copy link
Contributor

When encountering an unknown command fish defers to different handlers.
In #365 it was changed that these handlers receive all of $argv though that was quickly reverted as some handlers are unable to cope with that (3559f20 and 7a1fc02).

Some handlers like PackageKit however are able to deal with them and properly pass them along when executing the fixed commands.

~ $ grep SingleMatch /etc/PackageKit/CommandNotFound.conf  # this is just for demonstration
SingleMatch=ask
~ $ /usr/libexec/pk-command-not-found mna --version
fish: mna: command not found...
Run similar command: man [Y/n] y


man 2.9.4
~ $ mna --version
fish: mna: command not found...
Run similar command: man [Y/n] y


What manual page do you want?
For example, try 'man man'.
~ [127]$ function fish_command_not_found
             /usr/libexec/pk-command-not-found $argv
         end
~ $ mna --version
fish: mna: command not found...
Run similar command: man [Y/n] y


man 2.9.4

After looking at the current implementation I overwrote the function and everything still worked flawlessly.
I think it would be best to change this for the PackageKit handler.


Version: 3.3.1

@ridiculousfish
Copy link
Member

Sure, it seems reasonable to extend that logic to teach it about PackageKit. Note some handlers receive all the arguments. If you make a PR we'll merge it.

septatrix added a commit to septatrix/fish-shell that referenced this issue Dec 27, 2021
septatrix added a commit to septatrix/fish-shell that referenced this issue Dec 27, 2021
@zanchey zanchey linked a pull request Dec 28, 2021 that will close this issue
3 tasks
zanchey pushed a commit that referenced this issue Dec 28, 2021
@zanchey zanchey modified the milestones: fish-future, fish 3.4.0 Dec 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants