From 412bb24f6737a41768cb78c21f6dd575404751cb Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 23 Oct 2019 21:25:04 -0500 Subject: [PATCH] Fix .term bindings for commands with embedded ". The history file was correct (using reverse search or up arrow), but the key binding needs injected escapes to have correct syntax. --- 2019-kvm-forum/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2019-kvm-forum/functions b/2019-kvm-forum/functions index 7baaed0..99c033b 100644 --- a/2019-kvm-forum/functions +++ b/2019-kvm-forum/functions @@ -29,7 +29,8 @@ keys=(- OP OQ OR OS '[15~' '[17~' '[18~' '[19~' '[20~' '[21~') remember () { echo "$@" >> $HISTFILE - echo \"\\e${keys[$fnum]}\":\"\\C-k \\C-u"$@"\" >> $talkdir/bindings + echo "$@" | sed -e 's/"/\\"/g; s/$/"/' \ + -e 's/^/"\\e'"${keys[$fnum]}"'":"\\C-k \\C-u/' >> $talkdir/bindings ((fnum++)) } -- 1.8.3.1