How to copy and text from terminal to (GTK-)emacs?


student

If I select text in the terminal (in my case urxvt) and then middle click to the emacs window (GTK) it pastes the selected text from the terminal.

Since I don't want this behavior for the middle mouse button, I usually add this to my .emacsfile:

(define-key global-map [mouse-2] nil)

However, I cannot paste text from the terminal at all. So how can I fix it (eg by inserting a selection from the terminal C-y)?

This worked in my old version, but not since upgrading to ubuntu 13.10 and emacs24. So it must be possible, but I don't know how to do it.

cjm

In the Emacs manual , section 12.3.1 " Using the Clipboard" :

Before Emacs 24, the kill and yank commands used the primary selection, not the clipboard. If you like this behavior, change x-select-enable-clipboardto right nil, x-select-enable-primaryright t, and mouse-drag-copy-regionto t. In this case, you can use the following commands to explicitly perform actions on the clipboard: clipboard-kill-regionkill the region and save it to the clipboard; clipboard-kill-ring-savecopy the region to the kill ring and save it to the clipboard; then copy the region clipboard-yankin the clipboard The content moves to this point.

The key setting you want is x-select-enable-primaryto t. You can also mix and match the settings described here, depending on your preferred behavior.

Related


How to copy and text from terminal to (GTK-)emacs?

student If I select text in the terminal (in my case urxvt) and then middle click to the emacs window (GTK) it pastes the selected text from the terminal. Since I don't want this behavior for the middle mouse button, I usually add this to my .emacsfile: (defin

Copy from text to text in terminal

Never overlearn I'm new to the community and this is my first question, hope I'm doing it right. My problem: I'm learning some networking and analytics and have a long list of MAC addresses that I want to enter in the same sentence using the command line, but

Copy from text to text in terminal

Never overlearn I'm new to the community and this is my first question, hope I'm doing it right. My problem: I'm learning some networking and analytics and have a long list of MAC addresses that I want to enter in the same sentence using the command line, but

Copy from text to text in terminal

Never overlearn I'm new to the community and this is my first question, hope I'm doing it right. My problem: I'm learning some networking and analytics and have a long list of MAC addresses that I want to enter in the same sentence using the command line, but

How do I copy and paste text from an emacs document?

wolf is coming I'm writing my own emacs cheat sheet. So I want to copy the function description from emacs help. For example, in this screenshot, I want to replicate the "org-shifttab" feature description: The "mode" field filters the list of features. Press T

Separating line numbers from text in Terminal: Emacs

username When I run emacs in terminal mode with the global-linum-mode option enabled, the line numbers are very close to my text, which really annoys the eyes. Is there a way to separate line numbers from text in Emacs? Anton Kovalenko Try setting linum-format

Separating line numbers from text in Terminal: Emacs

username When I run emacs in terminal mode with the global-linum-mode option enabled, the line numbers are very close to my text, which really annoys the eyes. Is there a way to separate line numbers from text in Emacs? Anton Kovalenko Try setting linum-format

Separating line numbers from text in Terminal: Emacs

username When I run emacs in terminal mode with the global-linum-mode option enabled, the line numbers are very close to my text, which really annoys the eyes. Is there a way to separate line numbers from text in Emacs? Anton Kovalenko Try setting linum-format

Separating line numbers from text in Terminal: Emacs

username When I run emacs in terminal mode with the global-linum-mode option enabled, the line numbers are very close to my text, which really annoys the eyes. Is there a way to separate line numbers from text in Emacs? Anton Kovalenko Try setting linum-format

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy text from xfce4 terminal emulator to clipboard?

Abu Kai I want to be able to select some text with the mouse to copy and paste it into the command line. The "select" and "paste from clipboard/primary selection" parts work, but I can't copy the selection to the clipboard (verified xsel). So far I have tried:

How to copy text from xfce4 terminal emulator to clipboard?

Abu Kai I want to be able to select some text with the mouse to copy and paste it into the command line. The "select" and "paste from clipboard/primary selection" parts work, but I can't copy the selection to the clipboard (verified xsel). So far I have tried:

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy all text from the integrated vs code terminal?

Beko Is there a way to copy all text from the integrated Visual Studio Code terminal? I have some output that I want to copy to a text file and save. mark I can right-click on the terminal Select All, then select , then right-click and Copy. doesn't that work

How to copy text from xfce4 terminal emulator to clipboard?

Abu Kai I want to be able to select some text with the mouse to copy and paste it into the command line. The "select" and "paste from clipboard/primary selection" parts work, but I can't copy the selection to the clipboard (verified xsel). So far I have tried:

Copy text from one terminal to another

gas I ssh into a university account from my home computer. Then, find the file you want to copy to your local system. So, I opened a new shell terminal and intend to scpcopy it to my system. But the path to the file on the system I'm sshentering is quite long,