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

Let __fish_prepend_sudo use the last commandline if there is no current one #7079

merged 3 commits into from Jun 4, 2020


Copy link

@faho faho commented Jun 3, 2020


As we all know, !! is a frequently asked for feature, but 99.7% of the time it's specifically for sudo !!, which is just a super awkward interface.

This makes it so that __fish_prepend_sudo uses the previous commandline if the current commandline is empty, so we finally win on keystrokes against sudo !!. Truly that is the most important metric.


  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

faho added 3 commits June 3, 2020 16:16
Currently, if you press alt+s with an empty commandline, it inserts
"sudo", which seems fairly useless.

Now, it inserts "sudo " followed by the last history entry, which
makes it a replacement for `sudo !!`.
@faho faho added this to the fish 3.2.0 milestone Jun 3, 2020
Copy link

exploide commented Jun 3, 2020

so we finally win on keystrokes

I think fish already does, because Alt+S is three keystrokes while just typing sudo is already four.

But probably a good idea to make it even shorter 😃

@faho faho merged commit e646285 into fish-shell:master Jun 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants