I would like to create a command which fetches matching previous command, something like this:
match-latest "ssh root@150"
but which then exits and populates the command prompt with the most recent match, e.g.:
owilliams@OWILLIAMS010451 ~/go/ % ssh root@150.2.3.4
and leaves it for the user to edit (if desired) and press enter themself. Is this possible? How would I do it?
I am using zsh
5.8 on a MacBook Pro OSX