Last active
March 3, 2025 03:22
-
-
Save misshie/41643d820f7d459c7f0f2256494a2a14 to your computer and use it in GitHub Desktop.
Emacs init.el Configuration to Prevent Sudden Session Disconnection in Microsoft RDP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Explicitly copy/paste between the kill-ring and x-clipboard | |
;; using the xlip command | |
;; C-c y : yank from x-clipboard | |
;; C-c c : copy from kill-ring to x-clipboard | |
(setq x-select-enable-clipboard nil) | |
(setq x-select-enable-primary nil) | |
(defun yank-from-x-clipboard() | |
"Yank from X clipboard using xclip." | |
(interactive) | |
(insert (shell-command-to-string "xclip -selection clipboard -o"))) | |
(global-set-key (kbd "C-c y") 'yank-from-x-clipboard) | |
(defun copy-to-x-clipboard (text &optional push) | |
"Copyto X clipboard using xclip." | |
(interactive (list (current-kill 0))) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "xclip" "*Messages*" "xclip" "-selection" "clipboard"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) | |
(global-set-key (kbd "C-c c") 'copy-to-x-clipboard) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment