Open asdf23 opened 4 years ago
As far as I know, this is unavoidable in bash. (Solutions welcome!) It doesn't happen in zsh or fish.
This is certainly an issue. Please reopen.
The problem is described here:
mcfly search (query)
or insert the search query in the history file and invoke mcfly search
Bonus:
Nothing is unavoidable or impossible, it is only a matter of practicality for the hacks involved. In this case, it seems like it's only a small change.
With about 40 mins of searching and testing, I found that you can invoke functions using bind
, is there some reason that this feature isn't being used? I couldn't find a bash version where bind
was introduced, but I assume it is quite old, and in case we need to check for support, what's another nested if
statement between friends?
By replacing this line with bind -x '"\C-r": "array=($READLINE_LINE); echo \#mcfly: ${array[0]} > $MCFLY_HISTORY ; mcfly search"'
I was able to get the exact functionality described above.
I have made a PR here.
What I'm doing: Ctrl + R > ESC or
myfly search
> ESCI expect the screen to return to how it looked before my last command. Instead I see: