Skip to main content

Module focus

Module focus 

Source
Expand description

Encoding focus gained/lost events into terminal escape sequences (CSI I / CSI O) for focus reporting mode (mode 1004).

§Basic Usage

Use Event::encode to encode a focus event into a caller-provided buffer. If the buffer is too small, the method returns Err(Error::OutOfSpace { required }) where required is the required size.

§Example

use libghostty_vt::focus::Event;
let mut buf = [0u8; 8];
if let Ok(written) = Event::Gained.encode(&mut buf) {
    println!("Encoded {written} bytes: {:?}", &buf[..written]);
}

Enums§

Event
Event type for focus reporting mode (mode 1004).