Skip to content

Simulate the X11 select buffer #6250

@davidchisnall

Description

@davidchisnall

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions