I use Emacs in a terminal window on Linux, using the --no-window-system option.

Prior to version 24, if I clicked the middle mouse button in another application window, it would paste the last-killed region into that application via the X Windows primary selection. In version 24 this no long works; it appears that killing a region does not add that region to the X primary selection when Emacs is run from the shell.

When killing a region in the GUI version the region is added to the primary selection, but I would like to be able to use this feature while running Emacs in the terminal.

What can I add to my ~/.emacs file to make this work again?

  • What about telling us, what is already in your init file concerning clipboard config?
    – Nsukami _
    Apr 29, 2015 at 18:43
  • AFAIK this has never worked. I think your memory is faulty. There are some new xterm escape sequences which allow to do that, and Emacs-25 has recently acquired preliminary support for it (but Debian's xterm comes with the feature disabled by default, so you need to tweak your X resources to make use of the feature, because of potential security issues).
    – Stefan
    Apr 30, 2015 at 6:11
  • @Stefan, I realise now that I must have previously added xclip to my ~/.emacs and gotten used to it's funtionality, then while updating emacs and various other applications, the xclip program itself had become uninstalled so the xclip package wasn't having any effect. Thanks for your help. May 24, 2015 at 16:08

1 Answer 1


I suggest you try out the xclip package, availble in GNU ELPA.

  • I know this is an old post, but I have a weird issue with the xclip package. For some reason it will yank from xclip, but not cut/copy. Those still go to the Kill Menu.
    – Thomas
    Apr 30, 2018 at 0:51
  • @user2752635: This is not the place to sort out such issues. Please make it another question or just report it as a bug.
    – Stefan
    Apr 30, 2018 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.