2

I run emacs from command line using the command emacs -nw

However when I do this, and I try to copy paste something from, say, my browser to my emacs session, it returns me the error "kill ring is empty".

Can someone please let me know how I can copy/paste this way? Thanks.

mathmonkey
  • 203
  • 4
  • 14

3 Answers3

2

Programs run in terminal sessions don't have access to the windowing system clipboard. Use the cut and paste functionality provided by your terminal emulator. For example, in Gnome's terminal program press C-S-v (shift-control-V) to paste.

Alternatively, if you're using X11 you can use the xsel program to access the X selection. For example, this function will paste the current X selection into the current buffer:

(defun paste-from-x ()
  (interactive)
  (call-process "xsel" nil t))
ataylor
  • 60,501
  • 18
  • 147
  • 181
2

Does marking the text you want to copy with the mouse and then pressing Shift-Insert in Emacs work for you?

  • Indeed. Emacs command M-w, etc for copy-pasting your text, but Shift-Insert (or whatever else works for your terminal for importing stuff from the system clipboard. – Alex Gian Jun 14 '18 at 12:54
0

I think this previous answer of mine might help you:

First you need to install xclip

sudo apt-get install xclip

For Emacs 24

M-x package-list-packages

Select

xclip //mine was version 1.3

Detailed info and other operating systems https://stackoverflow.com/a/14659015/54848

Community
  • 1
  • 1
elviejo79
  • 4,522
  • 2
  • 29
  • 35