git.annexia.org
/
libguestfs-talks.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e93543
)
Fix .term bindings for commands with embedded ".
author
Eric Blake
<eblake@redhat.com>
Thu, 24 Oct 2019 02:25:04 +0000
(21:25 -0500)
committer
Eric Blake
<eblake@redhat.com>
Thu, 24 Oct 2019 02:29:01 +0000
(21:29 -0500)
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
patch
|
blob
|
history
diff --git
a/2019-kvm-forum/functions
b/2019-kvm-forum/functions
index
7baaed0
..
99c033b
100644
(file)
--- 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++))
}