From: Eric Blake Date: Thu, 24 Oct 2019 02:25:04 +0000 (-0500) Subject: Fix .term bindings for commands with embedded ". X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=412bb24f6737a41768cb78c21f6dd575404751cb;p=libguestfs-talks.git 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. --- 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++)) }