pub struct TerminalManager { /* private fields */ }Expand description
Terminal manager that wraps the PTY session
Implementations§
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn get_clipboard_history(&self, slot: ClipboardSlot) -> Vec<ClipboardEntry>
pub fn get_clipboard_history(&self, slot: ClipboardSlot) -> Vec<ClipboardEntry>
Get clipboard history for a specific slot
Sourcepub fn get_latest_clipboard(
&self,
slot: ClipboardSlot,
) -> Option<ClipboardEntry>
pub fn get_latest_clipboard( &self, slot: ClipboardSlot, ) -> Option<ClipboardEntry>
Get the most recent clipboard entry for a slot
Sourcepub fn search_clipboard_history(
&self,
query: &str,
slot: Option<ClipboardSlot>,
) -> Vec<ClipboardEntry>
pub fn search_clipboard_history( &self, query: &str, slot: Option<ClipboardSlot>, ) -> Vec<ClipboardEntry>
Search clipboard history across all slots or a specific slot
Sourcepub fn add_to_clipboard_history(
&self,
slot: ClipboardSlot,
content: String,
label: Option<String>,
)
pub fn add_to_clipboard_history( &self, slot: ClipboardSlot, content: String, label: Option<String>, )
Add content to clipboard history
Sourcepub fn clear_clipboard_history(&self, slot: ClipboardSlot)
pub fn clear_clipboard_history(&self, slot: ClipboardSlot)
Clear clipboard history for a specific slot
Sourcepub fn clear_all_clipboard_history(&self)
pub fn clear_all_clipboard_history(&self)
Clear all clipboard history
Sourcepub fn set_max_clipboard_sync_events(&self, max: usize)
pub fn set_max_clipboard_sync_events(&self, max: usize)
Set maximum clipboard sync events retained
Sourcepub fn set_max_clipboard_event_bytes(&self, max_bytes: usize)
pub fn set_max_clipboard_event_bytes(&self, max_bytes: usize)
Set maximum bytes cached per clipboard event
Sourcepub fn set_max_clipboard_sync_history(&self, max: usize)
pub fn set_max_clipboard_sync_history(&self, max: usize)
Set maximum clipboard history entries per slot
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn get_graphics(&self) -> Vec<TerminalGraphic>
pub fn get_graphics(&self) -> Vec<TerminalGraphic>
Get all graphics (Sixel, iTerm2, Kitty) Returns a vector of cloned TerminalGraphic objects for rendering
Sourcepub fn get_graphics_at_row(&self, row: usize) -> Vec<TerminalGraphic>
pub fn get_graphics_at_row(&self, row: usize) -> Vec<TerminalGraphic>
Get graphics at a specific row
Sourcepub fn graphics_count(&self) -> usize
pub fn graphics_count(&self) -> usize
Get total graphics count
Sourcepub fn get_scrollback_graphics(&self) -> Vec<TerminalGraphic>
pub fn get_scrollback_graphics(&self) -> Vec<TerminalGraphic>
Get all scrollback graphics
Sourcepub fn update_animations(&self) -> bool
pub fn update_animations(&self) -> bool
Update animations and return true if any frames changed
Sourcepub fn get_graphics_with_animations(&self) -> Vec<TerminalGraphic>
pub fn get_graphics_with_animations(&self) -> Vec<TerminalGraphic>
Get all graphics with current animation frames
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn get_all_hyperlinks(&self) -> Vec<HyperlinkInfo>
pub fn get_all_hyperlinks(&self) -> Vec<HyperlinkInfo>
Get all OSC 8 hyperlinks from the terminal
Sourcepub fn get_hyperlink_url(&self, hyperlink_id: u32) -> Option<String>
pub fn get_hyperlink_url(&self, hyperlink_id: u32) -> Option<String>
Get the URL for a specific hyperlink ID
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn spawn_shell(&mut self) -> Result<(), Error>
pub fn spawn_shell(&mut self) -> Result<(), Error>
Spawn a shell in the terminal
Sourcepub fn spawn_custom_shell(&mut self, command: &str) -> Result<(), Error>
pub fn spawn_custom_shell(&mut self, command: &str) -> Result<(), Error>
Spawn a custom shell command in the terminal
Sourcepub fn spawn_custom_shell_with_args(
&mut self,
command: &str,
args: &[String],
) -> Result<(), Error>
pub fn spawn_custom_shell_with_args( &mut self, command: &str, args: &[String], ) -> Result<(), Error>
Spawn a custom shell with arguments
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn new(cols: usize, rows: usize) -> Result<TerminalManager, Error>
pub fn new(cols: usize, rows: usize) -> Result<TerminalManager, Error>
Create a new terminal manager with the specified dimensions
Sourcepub fn new_with_scrollback(
cols: usize,
rows: usize,
scrollback_size: usize,
) -> Result<TerminalManager, Error>
pub fn new_with_scrollback( cols: usize, rows: usize, scrollback_size: usize, ) -> Result<TerminalManager, Error>
Create a new terminal manager with specified dimensions and scrollback size
Sourcepub fn update_scrollback_metadata(
&mut self,
scrollback_len: usize,
cursor_row: usize,
)
pub fn update_scrollback_metadata( &mut self, scrollback_len: usize, cursor_row: usize, )
Update scrollback metadata based on shell integration events from the core.
Drains the queued ShellIntegrationEvent events from the terminal, each of
which carries the cursor_line at the exact moment the OSC 133 marker was
parsed. This eliminates the batching problem where multiple markers arrive
between frames and only the last one was visible via marker().
Command text is captured from the terminal grid when the marker changes
away from CommandStart, then injected into scrollback marks after
apply_event() creates them.
Sourcepub fn scrollback_marks(&self) -> Vec<ScrollbackMark>
pub fn scrollback_marks(&self) -> Vec<ScrollbackMark>
Get rendered scrollback marks (prompt/command boundaries).
Sourcepub fn scrollback_previous_mark(&self, line: usize) -> Option<usize>
pub fn scrollback_previous_mark(&self, line: usize) -> Option<usize>
Find previous prompt mark before the given absolute line (if any).
Sourcepub fn scrollback_next_mark(&self, line: usize) -> Option<usize>
pub fn scrollback_next_mark(&self, line: usize) -> Option<usize>
Find next prompt mark after the given absolute line (if any).
Sourcepub fn core_command_history(&self) -> Vec<(String, Option<i32>, Option<u64>)>
pub fn core_command_history(&self) -> Vec<(String, Option<i32>, Option<u64>)>
Get command history from the core library (commands tracked via shell integration).
Returns commands as (command_text, exit_code, duration_ms) tuples.
Sourcepub fn set_cell_dimensions(&self, width: u32, height: u32)
pub fn set_cell_dimensions(&self, width: u32, height: u32)
Set cell dimensions in pixels for sixel graphics scroll calculations
Sourcepub fn write(&self, data: &[u8]) -> Result<(), Error>
pub fn write(&self, data: &[u8]) -> Result<(), Error>
Write data to the PTY (send user input to shell)
Sourcepub fn process_data(&self, data: &[u8])
pub fn process_data(&self, data: &[u8])
Process raw data through the terminal emulator (for tmux output routing).
Sourcepub fn paste(&self, content: &str) -> Result<(), Error>
pub fn paste(&self, content: &str) -> Result<(), Error>
Paste text to the terminal with proper bracketed paste handling.
Sourcepub async fn paste_with_delay(
&self,
content: &str,
delay_ms: u64,
) -> Result<(), Error>
pub async fn paste_with_delay( &self, content: &str, delay_ms: u64, ) -> Result<(), Error>
Paste text with a delay between lines.
Sourcepub fn resize_with_pixels(
&mut self,
cols: usize,
rows: usize,
width_px: usize,
height_px: usize,
) -> Result<(), Error>
pub fn resize_with_pixels( &mut self, cols: usize, rows: usize, width_px: usize, height_px: usize, ) -> Result<(), Error>
Resize the terminal with pixel dimensions
Sourcepub fn set_pixel_size(
&mut self,
width_px: usize,
height_px: usize,
) -> Result<(), Error>
pub fn set_pixel_size( &mut self, width_px: usize, height_px: usize, ) -> Result<(), Error>
Set pixel dimensions for XTWINOPS CSI 14 t query support
Sourcepub fn dimensions(&self) -> (usize, usize)
pub fn dimensions(&self) -> (usize, usize)
Get the current terminal dimensions
Sourcepub fn terminal(&self) -> Arc<Mutex<RawMutex, Terminal>>
pub fn terminal(&self) -> Arc<Mutex<RawMutex, Terminal>>
Get a clone of the underlying terminal for direct access
Sourcepub fn has_updates(&self) -> bool
pub fn has_updates(&self) -> bool
Check if there have been updates since last check
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the PTY is still running
Sourcepub fn bell_count(&self) -> u64
pub fn bell_count(&self) -> u64
Get the current bell event count
Sourcepub fn scrollback(&self) -> Vec<String>
pub fn scrollback(&self) -> Vec<String>
Get scrollback lines
Sourcepub fn scrollback_len(&self) -> usize
pub fn scrollback_len(&self) -> usize
Get scrollback length
Sourcepub fn line_text_at_absolute(&self, absolute_line: usize) -> Option<String>
pub fn line_text_at_absolute(&self, absolute_line: usize) -> Option<String>
Get text of a line at an absolute index (scrollback + screen).
Sourcepub fn lines_text_range(&self, start: usize, end: usize) -> Vec<(String, usize)>
pub fn lines_text_range(&self, start: usize, end: usize) -> Vec<(String, usize)>
Get all lines in a range as text (for search in copy mode).
Sourcepub fn scrollback_as_cells(&self) -> Vec<Vec<Cell>>
pub fn scrollback_as_cells(&self) -> Vec<Vec<Cell>>
Get all scrollback lines as Cell arrays.
Sourcepub fn clear_scrollback(&self)
pub fn clear_scrollback(&self)
Clear scrollback buffer
Sourcepub fn clear_scrollback_metadata(&mut self)
pub fn clear_scrollback_metadata(&mut self)
Clear scrollback metadata (prompt marks, command history, timestamps).
Sourcepub fn search(&self, query: &str, case_sensitive: bool) -> Vec<SearchMatch>
pub fn search(&self, query: &str, case_sensitive: bool) -> Vec<SearchMatch>
Search for text in the visible screen.
Sourcepub fn search_scrollback(
&self,
query: &str,
case_sensitive: bool,
max_lines: Option<usize>,
) -> Vec<SearchMatch>
pub fn search_scrollback( &self, query: &str, case_sensitive: bool, max_lines: Option<usize>, ) -> Vec<SearchMatch>
Search for text in the scrollback buffer.
Sourcepub fn search_all(&self, query: &str, case_sensitive: bool) -> Vec<SearchMatch>
pub fn search_all(&self, query: &str, case_sensitive: bool) -> Vec<SearchMatch>
Search for text in both visible screen and scrollback.
Sourcepub fn take_notifications(&self) -> Vec<Notification>
pub fn take_notifications(&self) -> Vec<Notification>
Take all pending OSC 9/777 notifications
Sourcepub fn has_notifications(&self) -> bool
pub fn has_notifications(&self) -> bool
Check if there are pending OSC 9/777 notifications
Sourcepub fn screenshot_to_file(
&self,
path: &Path,
format: &str,
scrollback_lines: usize,
) -> Result<(), Error>
pub fn screenshot_to_file( &self, path: &Path, format: &str, scrollback_lines: usize, ) -> Result<(), Error>
Take a screenshot of the terminal and save to file
Sourcepub fn record_marker(&self, label: String)
pub fn record_marker(&self, label: String)
Add a marker to the recording
Sourcepub fn export_recording_to_file(
&self,
session: &RecordingSession,
path: &Path,
format: &str,
) -> Result<(), Error>
pub fn export_recording_to_file( &self, session: &RecordingSession, path: &Path, format: &str, ) -> Result<(), Error>
Export recording to file (asciicast or JSON format)
Sourcepub fn shell_integration_cwd(&self) -> Option<String>
pub fn shell_integration_cwd(&self) -> Option<String>
Get current working directory from shell integration (OSC 7)
Sourcepub fn shell_integration_exit_code(&self) -> Option<i32>
pub fn shell_integration_exit_code(&self) -> Option<i32>
Get last command exit code from shell integration (OSC 133)
Sourcepub fn shell_integration_command(&self) -> Option<String>
pub fn shell_integration_command(&self) -> Option<String>
Get current command from shell integration
Sourcepub fn shell_integration_hostname(&self) -> Option<String>
pub fn shell_integration_hostname(&self) -> Option<String>
Get hostname from shell integration (OSC 7)
Sourcepub fn shell_integration_username(&self) -> Option<String>
pub fn shell_integration_username(&self) -> Option<String>
Get username from shell integration (OSC 7)
Sourcepub fn poll_cwd_events(&self) -> Vec<CwdChange>
pub fn poll_cwd_events(&self) -> Vec<CwdChange>
Poll CWD change events from terminal
Sourcepub fn poll_action_results(&self) -> Vec<ActionResult>
pub fn poll_action_results(&self) -> Vec<ActionResult>
Poll trigger action results from the core terminal.
pub fn get_active_transfers(&self) -> Vec<FileTransfer>
pub fn get_completed_transfers(&self) -> Vec<FileTransfer>
pub fn take_completed_transfer(&self, id: u64) -> Option<FileTransfer>
pub fn cancel_file_transfer(&self, id: u64) -> bool
pub fn send_upload_data(&self, data: &[u8])
pub fn cancel_upload(&self)
pub fn poll_upload_requests(&self) -> Vec<String>
pub fn custom_session_variables(&self) -> HashMap<String, String>
pub fn shell_integration_stats(&self) -> ShellIntegrationStats
Sourcepub fn cursor_position(&self) -> (usize, usize)
pub fn cursor_position(&self) -> (usize, usize)
Get cursor position
Sourcepub fn cursor_style(&self) -> CursorStyle
pub fn cursor_style(&self) -> CursorStyle
Get cursor style from terminal for rendering
Sourcepub fn set_cursor_style(&mut self, style: CursorStyle)
pub fn set_cursor_style(&mut self, style: CursorStyle)
Set cursor style for the terminal
Sourcepub fn is_cursor_visible(&self) -> bool
pub fn is_cursor_visible(&self) -> bool
Check if cursor is visible
Sourcepub fn is_mouse_tracking_enabled(&self) -> bool
pub fn is_mouse_tracking_enabled(&self) -> bool
Check if mouse tracking is enabled
Sourcepub fn report_focus_change(&self, focused: bool) -> bool
pub fn report_focus_change(&self, focused: bool) -> bool
Send focus event to PTY if the application has enabled focus tracking (DECSET 1004). Returns true if the event was sent.
Sourcepub fn is_alt_screen_active(&self) -> bool
pub fn is_alt_screen_active(&self) -> bool
Check if alternate screen is active
Sourcepub fn modify_other_keys_mode(&self) -> u8
pub fn modify_other_keys_mode(&self) -> u8
Get the modifyOtherKeys mode
Sourcepub fn application_cursor(&self) -> bool
pub fn application_cursor(&self) -> bool
Check if application cursor key mode (DECCKM) is enabled.
Sourcepub fn shell_integration_marker(&self) -> Option<ShellIntegrationMarker>
pub fn shell_integration_marker(&self) -> Option<ShellIntegrationMarker>
Get the current shell integration marker state
Sourcepub fn is_command_running(&self) -> bool
pub fn is_command_running(&self) -> bool
Check if a command is currently running based on shell integration
Sourcepub fn get_running_command_name(&self) -> Option<String>
pub fn get_running_command_name(&self) -> Option<String>
Get the name of the currently running command (first word only)
Sourcepub fn should_confirm_close(&self, jobs_to_ignore: &[String]) -> Option<String>
pub fn should_confirm_close(&self, jobs_to_ignore: &[String]) -> Option<String>
Check if tab close should show a confirmation dialog
Sourcepub fn should_report_mouse_motion(&self, button_pressed: bool) -> bool
pub fn should_report_mouse_motion(&self, button_pressed: bool) -> bool
Check if mouse motion events should be reported
Sourcepub fn encode_mouse_event(
&self,
button: u8,
col: usize,
row: usize,
pressed: bool,
modifiers: u8,
) -> Vec<u8> ⓘ
pub fn encode_mouse_event( &self, button: u8, col: usize, row: usize, pressed: bool, modifiers: u8, ) -> Vec<u8> ⓘ
Send a mouse event to the terminal and get the encoded bytes
Sourcepub fn get_styled_segments(&self) -> Vec<StyledSegment>
pub fn get_styled_segments(&self) -> Vec<StyledSegment>
Get styled segments from the terminal for rendering
Sourcepub fn update_generation(&self) -> u64
pub fn update_generation(&self) -> u64
Get the current generation number for dirty tracking
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn progress_bar(&self) -> ProgressBar
pub fn progress_bar(&self) -> ProgressBar
Get the simple progress bar state (OSC 9;4)
Sourcepub fn named_progress_bars(&self) -> HashMap<String, NamedProgressBar>
pub fn named_progress_bars(&self) -> HashMap<String, NamedProgressBar>
Get all named progress bars (OSC 934)
Sourcepub fn has_any_progress(&self) -> bool
pub fn has_any_progress(&self) -> bool
Check if any progress bar is currently active
Source§impl TerminalManager
impl TerminalManager
pub fn set_answerback_string(&self, answerback: Option<String>)
pub fn set_width_config(&self, config: WidthConfig)
pub fn set_normalization_form(&self, form: NormalizationForm)
pub fn set_output_callback<F>(&self, callback: F)
pub fn start_recording(&self, title: Option<String>)
pub fn stop_recording(&self) -> Option<RecordingSession>
pub fn is_recording(&self) -> bool
pub fn export_asciicast(&self, session: &RecordingSession) -> String
Source§impl TerminalManager
impl TerminalManager
pub fn start_coprocess(&self, config: CoprocessConfig) -> Result<u64, String>
pub fn stop_coprocess(&self, id: u64) -> Result<(), String>
pub fn coprocess_status(&self, id: u64) -> Option<bool>
pub fn read_from_coprocess(&self, id: u64) -> Result<Vec<String>, String>
pub fn list_coprocesses(&self) -> Vec<u64>
pub fn read_coprocess_errors(&self, id: u64) -> Result<Vec<String>, String>
Source§impl TerminalManager
impl TerminalManager
pub fn set_tmux_control_mode(&self, enabled: bool)
pub fn is_tmux_control_mode(&self) -> bool
pub fn drain_tmux_notifications(&self) -> Vec<TmuxNotification>
pub fn tmux_notifications(&self) -> Vec<TmuxNotification>
Source§impl TerminalManager
impl TerminalManager
Sourcepub fn sync_triggers(&self, triggers: &[TriggerConfig])
pub fn sync_triggers(&self, triggers: &[TriggerConfig])
Sync trigger configs from Config into the core TriggerRegistry.
Source§impl TerminalManager
impl TerminalManager
pub fn add_observer(&self, observer: Arc<dyn TerminalObserver>) -> u64
pub fn remove_observer(&self, id: u64) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TerminalManager
impl !RefUnwindSafe for TerminalManager
impl Send for TerminalManager
impl Sync for TerminalManager
impl Unpin for TerminalManager
impl UnsafeUnpin for TerminalManager
impl !UnwindSafe for TerminalManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more