Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On Linux, it has basically always worked that way. However, there are essentially two¹ different clipboards. Of course some applications could do things differently, but usually they will use what you think of as the clipboard for keyboard shortcuts like control–c and control–v, while selecting things with the mouse uses a separate system².

There are some interesting differences between them as well. When using the clipboard your application sends whatever you copied to the clipboard and pasting copies it out of the clipboard. With selection, however, the application merely announces that the user has selected something in that application. When you middle–click to paste, the application you pasted into must send a message to whichever application was most recently used to select something (relayed via the X server), and the reply contains the selected data.

https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM...

¹ Actually, there are three³. CLIPBOARD for control–c/v, PRIMARY for selecting with the mouse, and SECONDARY for selecting with the mouse while holding down alt.

² But of course these two systems are implemented using the same messages to and from the X server. They simply have different conventions for how they are used.

³ Actually, there are as many as you care to implement. These three are simply conventional; applications are free to use other names to identify other communication channels.

⁴ … Profit!



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: