I'd like the implementation to give the user a list of the most recent 5 commands run and then use the first word of their choice as the command. I was planning to add this, however, there seems to be no existing way to parse history files across different shells.
For example: bash's history file is at ~/.bash_history and is just a list of commands, zsh's history file is at ~/.zsh_history with a list of commands prefaced with a timestamp, and fish's history file is at ~/.local/share/fish/fish_history with 2 lines per command run (one with a timestamp). Not to mention some shells use a SQL-based history file!
Maybe this could just support a few shells (bash, fish, and zsh)?
As a compromise, I think an acceptable alternative would to let the user pass in the full command they tried to run that didn't work using !! and then just take the first value passed in -c.
I'd like the implementation to give the user a list of the most recent 5 commands run and then use the first word of their choice as the command. I was planning to add this, however, there seems to be no existing way to parse history files across different shells.
For example: bash's history file is at
~/.bash_history
and is just a list of commands, zsh's history file is at~/.zsh_history
with a list of commands prefaced with a timestamp, and fish's history file is at~/.local/share/fish/fish_history
with 2 lines per command run (one with a timestamp). Not to mention some shells use a SQL-based history file!Maybe this could just support a few shells (bash, fish, and zsh)?