Function query_osc_buffer

Source
pub fn query_osc_buffer<'b, MS: Into<u64> + Copy>(
    query: &str,
    buffer: &'b mut [u8],
    timeout_ms: MS,
) -> Result<&'b [u8], XQError>
Expand description

Query the xterm interface for an OSC response, assuming the terminal is in raw mode (or we would block waiting for a newline).

The provided query should be a proper OSC sequence (ie already wrapped, eg “\x1b]11;?\x07”)

Return a slice of the buffer containing the response. This slice excludes

  • the response start (ESC) and everything before
  • the response end (ESC or BEL) and everything after

OSC sequence: https://en.wikipedia.org/wiki/ANSI_escape_code#OSC_(Operating_System_Command)_sequences