mathmonkey
mathmonkey

Reputation: 335

copy/paste from emacs in command line

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.

Upvotes: 3

Views: 1788

Answers (3)

elviejo79
elviejo79

Reputation: 4600

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

Upvotes: 0

Kjell Andreassen
Kjell Andreassen

Reputation: 763

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

Upvotes: 2

ataylor
ataylor

Reputation: 66109

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))

Upvotes: 2

Related Questions