cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.76k stars 176 forks source link

Fix the handling of open-quote strings in fish #272

Closed hivehand closed 1 year ago

hivehand commented 1 year ago

In fish, with McFly initiated, hitting Control-R when the existing command line contains an unmatched quote currently triggers a fish error, e.g.:

❯ echo "Hi- (line 1): Unexpected end of string, quotes are not balanced
/opt/homebrew/bin/mcfly --mcfly_history /dev/null --history_format fish search -o $mcfly_output -- echo "Hi
                                                                                                        ^

Fortunately, the solution is simple: use fish's own string escape to escape the output of commandline before passing it to mcfly as an argument.

cantino commented 1 year ago

Thanks @hivehand!