-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
X11 provides multiple buffers (clipboards / pasteboards) with different semantics. The copy buffer is used for things that persist in the buffer. The select buffer shares some of the behaviour of copy-and-paste and some of drag-and-drop. Like drag-and-drop, the source is responsible for the storage of the buffer contents and the buffer goes away when the source changes this. Like copy-and-paste, copying (select) and pasting (middle click) are distinct operations that do not capture the mouse in the middle.
It is very useful to have access to both in a terminal. This works well in X11 terminals on Windows with VcXsrv:
- The select buffer (filled when you select text) is not copied to the Windows clipboard.
- The copy buffer (filled when you do a copy operation) is copied to the Windows clipboard.
- Changes to the Windows clipboard are mirrored into the X11 copy buffer.
- Middle click pastes from the select buffer if the select buffer contains anything, otherwise it pastes from the copy buffer.
This behaviour could be emulated by having a buffer that is internal to WT that is filled on select and used for a special paste option (which could be bound to middle-click once #1553 is resolved).