aboutsummaryrefslogtreecommitdiff
path: root/vterm.el
diff options
context:
space:
mode:
authorYubao Liu <yubao.liu@gmail.com>2021-01-30 23:13:50 +0800
committerYubao Liu <yubao.liu@gmail.com>2021-01-30 23:13:50 +0800
commit32a6171915d64fca5eb02bbdc6888f66927512c1 (patch)
tree94da598d25e230b9e8383e30f9191ab8dd45051e /vterm.el
parentc43e30ceae731ff7cba812deb0b1872528724134 (diff)
deactivate mark on key input
Inspired by emacs/lisp/term.el:term-send-raw-string, fixed issue https://github.com/akermu/emacs-libvterm/issues/489.
Diffstat (limited to 'vterm.el')
-rw-r--r--vterm.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/vterm.el b/vterm.el
index b2f08dd..d4f82e0 100644
--- a/vterm.el
+++ b/vterm.el
@@ -797,6 +797,7 @@ will invert `vterm-copy-exclude-prompt' for that call."
(defun vterm-send-key (key &optional shift meta ctrl)
"Send KEY to libvterm with optional modifiers SHIFT, META and CTRL."
+ (deactivate-mark)
(when vterm--term
(let ((inhibit-redisplay t)
(inhibit-read-only t))
@@ -829,6 +830,7 @@ will invert `vterm-copy-exclude-prompt' for that call."
(defun vterm-send-return ()
"Send `C-m' to the libvterm."
(interactive)
+ (deactivate-mark)
(when vterm--term
(if (vterm--get-icrnl vterm--term)
(process-send-string vterm--process "\C-j")
@@ -939,6 +941,7 @@ prefix argument ARG or with \\[universal-argument]."
Argument ARG is passed to `yank'."
(interactive "P")
+ (deactivate-mark)
(vterm-goto-char (point))
(let ((inhibit-read-only t))
(cl-letf (((symbol-function 'insert-for-yank) #'vterm-insert))