Skip to main content

SessionOptions

Struct SessionOptions 

Source
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: bool

Enable 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: bool

Enable 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: bool

Enable 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: bool

Enable 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: bool

Enable 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

Source§

fn clone(&self) -> SessionOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SessionOptions

Source§

fn default() -> SessionOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.