[−]Struct xterm_js_sys::xterm::WindowOptions
Enable various window manipulation and report features (CSI Ps ; Ps ; Ps t
).
Most settings have no default implementation, as they heavily rely on the embedding environment.
To implement a feature, create a custom CSI hook like this:
term.parser.addCsiHandler({final: 't'}, params => {
const ps = params[0];
switch (ps) {
case XY:
... // your implementation for option XY
return true; // signal Ps=XY was handled
}
return false; // any Ps that was not handled
});
Note on security: Most features are meant to deal with some information of the host machine where the terminal runs on. This is seen as a security risk possibly leaking sensitive data of the host to the program in the terminal. Therefore all options (even those without a default implementation) are guarded by the boolean flag and disabled by default.
(This is really an interface, but we just go and define our own type that satisfies the interface.)
Fields
fullscreen_win: Option<bool>
Ps=10 ; 0 Undo full-screen mode. Ps=10 ; 1 Change to full-screen. Ps=10 ; 2 Toggle full-screen.
No default implementation.
get_cell_size_pixels: Option<bool>
Ps=16 Report xterm character cell size in pixels. Result is “CSI 6 ; height ; width t”.
Has a default implementation.
get_icon_title: Option<bool>
Ps=20 Report xterm window’s icon label. Result is “OSC L label ST”.
No default implementation.
get_screen_size_chars: Option<bool>
Ps=19 Report the size of the screen in characters. Result is “CSI 9 ; height ; width t”.
No default implementation.
get_screen_size_pixels: Option<bool>
Ps=15 Report size of the screen in pixels. Result is “CSI 5 ; height ; width t”.
No default implementation.
get_win_position: Option<bool>
Ps=13 Report xterm window position. Result is “CSI 3 ; x ; y t”. Ps=13 ; 2 Report xterm text-area position. Result is “CSI 3 ; x ; y t”.
No default implementation.
get_win_size_chars: Option<bool>
Ps=18 Report the size of the text area in characters. Result is “CSI 8 ; height ; width t”.
Has a default implementation.
get_win_size_pixels: Option<bool>
Ps=14 Report xterm text area size in pixels. Result is “CSI 4 ; height ; width t”. Ps=14 ; 2 Report xterm window size in pixels. Result is “CSI 4 ; height ; width t”.
Has a default implementation.
get_win_state: Option<bool>
Ps=11 Report xterm window state. If the xterm window is non-iconified, it returns “CSI 1 t”. If the xterm window is iconified, it returns “CSI 2 t”.
No default implementation.
get_win_title: Option<bool>
Ps=21 Report xterm window’s title. Result is “OSC l label ST”.
No default implementation.
lower_win: Option<bool>
Ps=6 Lower the xterm window to the bottom of the stacking order.
No default implementation.
maximize_win: Option<bool>
Ps=9 ; 0 Restore maximized window. Ps=9 ; 1 Maximize window (i.e., resize to screen size). Ps=9 ; 2 Maximize window vertically. Ps=9 ; 3 Maximize window horizontally.
No default implementation.
minimize_win: Option<bool>
Ps=2 Iconify window.
No default implementation.
pop_title: Option<bool>
Ps=23 ; 0 Restore xterm icon and window title from stack. Ps=23 ; 1 Restore xterm icon title from stack. Ps=23 ; 2 Restore xterm window title from stack.
All variants have a default implementation.
push_title: Option<bool>
Ps=22 ; 0 Save xterm icon and window title on stack. Ps=22 ; 1 Save xterm icon title on stack. Ps=22 ; 2 Save xterm window title on stack.
All variants have a default implementation.
raise_win: Option<bool>
Ps=5 Raise the window to the front of the stacking order.
No default implementation.
refresh_win: Option<bool>
Ps=7 Refresh the window.
restore_win: Option<bool>
Ps=1 De-iconify window.
No default implementation.
set_win_lines: Option<bool>
Ps>=24 Resize to Ps lines (DECSLPP). DECSLPP is not implemented. This settings is also used to enable / disable DECCOLM (earlier variant of DECSLPP).
set_win_position: Option<bool>
Ps=3 ; x ; y Move window to [x, y].
No default implementation.
set_win_size_chars: Option<bool>
Ps = 8 ; height ; width Resize the text area to given height and width in characters. Omitted parameters should reuse the current height or width. Zero parameters use the display’s height or width.
No default implementation.
set_win_size_pixels: Option<bool>
Ps = 4 ; height ; width Resize the window to given height and width in pixels. Omitted parameters should reuse the current height or width. Zero parameters should use the display’s height or width.
No default implementation.
Implementations
impl WindowOptions
[src]
#[must_use]pub const fn new(
fullscreen_win: Option<bool>,
get_cell_size_pixels: Option<bool>,
get_icon_title: Option<bool>,
get_screen_size_chars: Option<bool>,
get_screen_size_pixels: Option<bool>,
get_win_position: Option<bool>,
get_win_size_chars: Option<bool>,
get_win_size_pixels: Option<bool>,
get_win_state: Option<bool>,
get_win_title: Option<bool>,
lower_win: Option<bool>,
maximize_win: Option<bool>,
minimize_win: Option<bool>,
pop_title: Option<bool>,
push_title: Option<bool>,
raise_win: Option<bool>,
refresh_win: Option<bool>,
restore_win: Option<bool>,
set_win_lines: Option<bool>,
set_win_position: Option<bool>,
set_win_size_chars: Option<bool>,
set_win_size_pixels: Option<bool>
) -> Self
[src]
fullscreen_win: Option<bool>,
get_cell_size_pixels: Option<bool>,
get_icon_title: Option<bool>,
get_screen_size_chars: Option<bool>,
get_screen_size_pixels: Option<bool>,
get_win_position: Option<bool>,
get_win_size_chars: Option<bool>,
get_win_size_pixels: Option<bool>,
get_win_state: Option<bool>,
get_win_title: Option<bool>,
lower_win: Option<bool>,
maximize_win: Option<bool>,
minimize_win: Option<bool>,
pop_title: Option<bool>,
push_title: Option<bool>,
raise_win: Option<bool>,
refresh_win: Option<bool>,
restore_win: Option<bool>,
set_win_lines: Option<bool>,
set_win_position: Option<bool>,
set_win_size_chars: Option<bool>,
set_win_size_pixels: Option<bool>
) -> Self
Constructor.
impl WindowOptions
[src]
#[must_use]pub const fn default() -> Self
[src]
feature="ext"
only.Constructor for WindowOptions
.
#[must_use]pub const fn with_fullscreen_win(self, fullscreen_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::fullscreen_win
.
#[must_use]pub const fn with_get_cell_size_pixels(self, get_cell_size_pixels: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_cell_size_pixels
.
#[must_use]pub const fn with_get_icon_title(self, get_icon_title: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_icon_title
.
#[must_use]pub const fn with_get_screen_size_chars(
self,
get_screen_size_chars: bool
) -> Self
[src]
self,
get_screen_size_chars: bool
) -> Self
feature="ext"
only.Builder pattern setter for WindowOptions::get_screen_size_chars
.
#[must_use]pub const fn with_get_screen_size_pixels(
self,
get_screen_size_pixels: bool
) -> Self
[src]
self,
get_screen_size_pixels: bool
) -> Self
feature="ext"
only.Builder pattern setter for WindowOptions::get_screen_size_pixels
.
#[must_use]pub const fn with_get_win_position(self, get_win_position: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_win_position
.
#[must_use]pub const fn with_get_win_size_chars(self, get_win_size_chars: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_win_size_chars
.
#[must_use]pub const fn with_get_win_size_pixels(self, get_win_size_pixels: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_win_size_pixels
.
#[must_use]pub const fn with_get_win_state(self, get_win_state: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_win_state
.
#[must_use]pub const fn with_get_win_title(self, get_win_title: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::get_win_title
.
#[must_use]pub const fn with_lower_win(self, lower_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::lower_win
.
#[must_use]pub const fn with_maximize_win(self, maximize_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::maximize_win
.
#[must_use]pub const fn with_minimize_win(self, minimize_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::minimize_win
.
#[must_use]pub const fn with_pop_title(self, pop_title: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::pop_title
.
#[must_use]pub const fn with_push_title(self, push_title: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::push_title
.
#[must_use]pub const fn with_raise_win(self, raise_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::raise_win
.
#[must_use]pub const fn with_refresh_win(self, refresh_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::refresh_win
.
#[must_use]pub const fn with_restore_win(self, restore_win: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::restore_win
.
#[must_use]pub const fn with_set_win_lines(self, set_win_lines: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::set_win_lines
.
#[must_use]pub const fn with_set_win_position(self, set_win_position: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::set_win_position
.
#[must_use]pub const fn with_set_win_size_chars(self, set_win_size_chars: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::set_win_size_chars
.
#[must_use]pub const fn with_set_win_size_pixels(self, set_win_size_pixels: bool) -> Self
[src]
feature="ext"
only.Builder pattern setter for WindowOptions::set_win_size_pixels
.
Trait Implementations
impl Clone for WindowOptions
fn clone(&self) -> WindowOptions
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WindowOptions
impl Default for WindowOptions
fn default() -> WindowOptions
impl Eq for WindowOptions
impl From<WindowOptions> for JsValue
[src]
fn from(value: WindowOptions) -> Self
[src]
impl FromWasmAbi for WindowOptions
[src]
type Abi = u32
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for WindowOptions
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
impl OptionFromWasmAbi for WindowOptions
[src]
impl OptionIntoWasmAbi for WindowOptions
[src]
impl PartialEq<WindowOptions> for WindowOptions
fn eq(&self, other: &WindowOptions) -> bool
fn ne(&self, other: &WindowOptions) -> bool
impl RefFromWasmAbi for WindowOptions
[src]
type Abi = u32
The wasm ABI type references to Self
are recovered from.
type Anchor = Ref<'static, WindowOptions>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for WindowOptions
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, WindowOptions>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl StructuralEq for WindowOptions
impl StructuralPartialEq for WindowOptions
impl WasmDescribe for WindowOptions
[src]
Auto Trait Implementations
impl RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnwindSafe for WindowOptions
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,