From 48172ceefad98f0aca47a4fad5591a477b7669b4 Mon Sep 17 00:00:00 2001 From: Inc0n Date: Mon, 27 Jun 2022 00:41:19 +0100 Subject: [PATCH] Make C-k also copy same region, it would also kill --- vterm.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vterm.el b/vterm.el index 630b50e..af19092 100644 --- a/vterm.el +++ b/vterm.el @@ -938,6 +938,14 @@ running in the terminal (like Emacs or Nano)." (memq 'shift modifiers) (memq 'meta modifiers) (memq 'control modifiers))))) + +(defun vterm-send-C-k () + "Send `C-k' to the libvterm and copy that region." + (interactive) + (let ((end (save-excursion + (end-of-visible-line) (point)))) + (copy-region-as-kill (point) end)) + (vterm-send "C-k")) (defun vterm-send-start () "Output from the system is started when the system receives START."