-
Notifications
You must be signed in to change notification settings - Fork 0
[FEATURE] Execute previous commands #7
Description
Is your feature request related to a problem? Please describe.
It is very useful to access previous commands in a shell without going back to the whole line.
Describe the solution you'd like
In many shells, there is a built-in !! which represents the last executing command. For example, when running sudo !! after apt update, it runs sudo apt update. Just executing !! runs the last command again.
Similarly, those shells allow writing ! followed by text and it then executes the last command that starts with that text (e.g. sudo !apt runs sudo apt update)
Describe alternatives you've considered
It would also be possible to use a different character but that would be surprising to people who used other shells before.
Additional context
This should work in scripts as well as in interactive mode (like any syntax feature).
It should also work inside variable substitutions, function calls etc.