Bloc notes | Tmux, emacs copy & paste over ssh

Posted on July 1, 2016 by Alex comments [ssh, tmux, emacs]

Install xclip

on ssh server


nix-shell -i xclip


apt install xclip

Configuration tmux

on ssh server, edit ~/.tmux.conf

# To copy:
bind-key -n -t emacs-copy M-w copy-pipe "xclip -i -sel p -f | xclip -i -sel c"
# To paste:
bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer"

Configuration emacs

on ssh server edit ~/.emacs.el

(use-package xclip
  :ensure t
  (xclip-mode 1))

SSH Client

From your ssh client, connect to tmux's ssh server.

ssh -YC my.srv