Skip to main content

request_selection

Function request_selection 

Source
pub fn request_selection(sel: impl IntoIterator<Item = Selection>) -> String
Expand description

Requests selection for the first available of the given selection buffers. If empty requests the default buffer selection.

Equivalent to OSC ? 5 2 ; Pb ST where Pb is all the buffers requested in precedence order. It is any number of the following characters:

  • c: clipboard
  • p: primary
  • q: secondary
  • s: select
  • 0 - 7: cut 0 - cut 7

The terminal will reply with CSI 1 2 ; Pb ; Ps ST where Ps is the the selection data in base64 and Pb are the requested selection buffers.

Termal can parse the response as crate::raw::events::Event::Status with crate::raw::events::Status::SelectionData with bytes stored in the selection buffer. So the read event will match Event::Status(Status::SelectionData(_)).

Note that the response selection buffers are not in the response.

See REQUEST_SELECTION for more info.