Skip to content

[FEATURE] Execute previous commands #7

@danthe1st

Description

@danthe1st

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions