I use Emacs in the terminal (
emacs -nw) and xclip.el for synchronising the kill ring with the X clipboard. Under normal circumstances this works fine, but when visiting buffers with tramp xclip is not able to set the X clipboard. I believe something is failing with the xclip shell command when run through tramp, but I don't know how to debug it.
Investigating so far I have found:
- Yanking in a tramp buffer works fine and is able to yank from the kill ring or X clipboard.
- Killing text under tramp causes the text to be added to the kill ring, but the X clipboard does not get set.
- It doesn't matter which user or host is used to access files through tramp - I can visit files using
/sudo:myusername@localhost:/...and the failure still occurs.
- xclip processes don't get closed after killing text in a tramp process, which is what leads me to believe something is failing there. I see the text below when I close Emacs. (This does not occur when killing to xclip in a normal buffer).
Active processes exist; kill them and exit anyway? (yes or no)
Process [v] Status Buffer TTY Command xclip run -- /dev/pts/6 /bin/sh -i xclip<1> run -- /dev/pts/7 /bin/sh -i
process-send-string to run xclip, but I don't know how to debug these functions or see if there is any error output. There are no errors in the Messages buffer.
Is there something I can do to fix this problem or some way to debug what is going wrong with the xclip shell commands?