3

My current setup consists of an OS X host machine in which I run iTerm. From inside iTerm I ssh into a second machine in which I do all the development. In there I run tmux, and inside tmux I run Spacemacs.

The experience is quite smooth with the only exception of copy-pasting. When I copy/paste from inside emacs, it interacts with the second machine's clipboard. Is there any way make it also use the host's clipboard instead? I would imagine that for copying it could execute a hook after each yank that would send via ssh the copied text to "pbcopy" in the host machine, and for pasting it could have a custom registry that would use the host's "pbpaste", also via ssh.

Jesuspc
  • 1,664
  • 10
  • 25
  • Questions about *using* programs such as Emacs are off-topic for Stack Overflow unless they are specific to programming modes; you may be able to get help on [emacs.se] or [su]. If your question is about programming Emacs, then please [edit] to include a [mcve] of the Lisp or C code you're having trouble with. – Toby Speight Nov 10 '17 at 10:26
  • @Jesuspc I have the same problem now. How was it resolved? – Keiku Sep 10 '18 at 06:52
  • @Keiku See my answer – Jesuspc Sep 12 '18 at 14:09

1 Answers1

2

I managed to make it work with an xclip integration.

First of all make sure that xclip is installed in your development machine. When you ssh into the development machine forward X11 with ssh -Y.

In the development machine, in dotspacemacs/layers, as dotspacemacs-additional-packages, add xclip:

dotspacemacs-additional-packages '(xclip)

Also in the development machine, in dotspacemacs/user-config add:

;; == Terminal ==
;; XClip integration

(require 'xclip)
(define-globalized-minor-mode global-xclip-mode
  xclip-mode xclip-mode)

(global-xclip-mode 1)

There is also an issue open in Spacemacs to add a layer to provide that functionality.

Jesuspc
  • 1,664
  • 10
  • 25