mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

Fix the handling of open-quote strings in fish

Open hivehand opened this issue 2 years ago • 0 comments

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.

hivehand avatar Jul 30 '22 05:07 hivehand