Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"yank" does not paste text when using Emacs over SSH

Tags:

emacs

ssh

yank

When I tried to run Emacs on a remote server through ssh, the C-y (even M-x yank) can't work. Every time I press C-y, it says "Mark set", but nothing else happens. I'm working under Linux and the remote server is a Mac pro.

Now I can only download the file to my pc. Any ideas on how to better solve this problem?

like image 534
andy90 Avatar asked Nov 22 '12 17:11

andy90


1 Answers

I suspect your problem is not due to Emacs running remotely, but instead it is due to Emacs running in "text mode" (i.e. running inside a terminal emulator). When running in such a mode, Emacs does not know about any surrounding GUI that might be running, so C-y only yanks text you have previously killed in the same Emacs session via something like C-w or M-w.

You can try to do a "paste" in your terminal emulator (probably Cmd-v), which will send the selected text to the underlying application (in this case, Emacs) as if it had been typed. As long as the text you're pasting is made of "simple enough" characters it might work fine. If it contains any funny control chars, all bets are off (if it contains non-ASCII chars it may also behave in a funny way, depending on whether the whole "terminal-emulator+ssh+Emacs" are configured just right or not).

like image 194
Stefan Avatar answered Oct 01 '22 09:10

Stefan