1

I’ve read this answer on superuser.com by grawity and part of the text “X Selections, Cut Buffers, and Kill Rings.” by Jamie Zawinski.

I understand there’s the primary register: use the mouse to select text, then use the middle mouse button to paste it. And on the other hand, there’s the clipboard (ctrl-c / ctrl-v).

But how do I access the primary register when I don’t have a mouse with that button, or when I don’t have a mouse at all (since I can also feed text to the register by selecting it with the keyboard)? Is there a keyboard shortcut to access it instead of using the mouse?

I saw this question, but it specifically asks about rxvt, whereas the primary register is a feature of X (I believe).

I couldn’t find an answer to that in the mentioned texts. shift-ins seems to work the same way as ctrl-v, so this isn’t what I‘m looking for.

0

There's no primary "register". There's an arbitrary number of selections, which basically is just an X application saying "currently, I hold this particular selection".

There is no "clipboard" in the Windows sense (Ctrl-C copies to the clipboard, Ctrl-V pastes from the clipboard). Instead, X applications talk to each other, and one X application can say to another application "please give me your selection" when the user does something (for example, presses the middle mouse button).

However, applications like xclipboard, or sometimes the window manager in popular desktop environments, can take over the selection instead of the application holding it originally. This makes the whole process more similar to Windows.

Any user interaction can be interpreted by a particular application to request the contents of the selection from another application, or to modify and claim its own selection: By convention, you can drag the mouse, use the middle mouse buttons, or use particular keys. What to use can differ from application to application.

If you don't have a mouse with a particular button, or particular keys, you need to configure each particular application that needs those to use different mouse buttons or keys. If the application doesn't support configuring it, you can synthesize mouse button or key presses in other ways.

You can also use command-line applications like xclip in scripts to access or provide the selection.

If your question is something like "how do I cut and paste from the keyboard in a particular application", please edit your question and mention the application. There's no generic approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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