pub struct SessionOptions {
pub alternate_screen: bool,
pub mouse_capture: bool,
pub bracketed_paste: bool,
pub focus_events: bool,
pub kitty_keyboard: bool,
}Expand description
Terminal session configuration options.
These options control which terminal modes are enabled when a session
starts. All options default to false for maximum portability.
§Example
use ftui_core::terminal_session::SessionOptions;
// Full-featured TUI
let opts = SessionOptions {
alternate_screen: true,
mouse_capture: true,
bracketed_paste: true,
focus_events: true,
..Default::default()
};
// Minimal inline mode
let inline_opts = SessionOptions::default();Fields§
§alternate_screen: boolEnable alternate screen buffer (CSI ? 1049 h).
When enabled, the terminal switches to a separate screen buffer, preserving the original scrollback. On exit, the original screen is restored.
Use this for full-screen applications. For inline mode (preserving
scrollback), leave this false.
mouse_capture: boolEnable mouse capture with SGR encoding (CSI ? 1000;1002;1006 h).
Enables:
- Normal mouse tracking (1000)
- Button event tracking (1002)
- SGR extended coordinates (1006) - supports coordinates > 223
bracketed_paste: boolEnable bracketed paste mode (CSI ? 2004 h).
When enabled, pasted text is wrapped in escape sequences:
- Start:
ESC [ 200 ~ - End:
ESC [ 201 ~
This allows distinguishing pasted text from typed text.
focus_events: boolEnable focus change events (CSI ? 1004 h).
When enabled, the terminal sends events when focus is gained or lost:
- Focus in:
ESC [ I - Focus out:
ESC [ O
kitty_keyboard: boolEnable Kitty keyboard protocol (pushes flags with CSI > 15 u).
Uses the kitty protocol to report repeat/release events and disambiguate keys. This is optional and only supported by select terminals.
Trait Implementations§
Source§impl Clone for SessionOptions
impl Clone for SessionOptions
Source§fn clone(&self) -> SessionOptions
fn clone(&self) -> SessionOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more