pub struct AppSession { /* private fields */ }Expand description
App-level session that layers VT Code features on top of the core session.
Implementations§
Source§impl AppSession
impl AppSession
pub fn handle_event( &mut self, event: CrosstermEvent, events: &UnboundedSender<InlineEvent>, callback: Option<&(dyn Fn(&InlineEvent) + Send + Sync + 'static)>, )
Source§impl AppSession
impl AppSession
Sourcepub fn check_file_reference_trigger(&mut self)
pub fn check_file_reference_trigger(&mut self)
Check if the current input should trigger the file palette
Source§impl AppSession
impl AppSession
pub fn new_with_logs( theme: InlineTheme, placeholder: Option<String>, view_rows: u16, show_logs: bool, appearance: Option<AppearanceConfig>, slash_commands: Vec<SlashCommandItem>, app_name: String, ) -> Self
pub fn new( theme: InlineTheme, placeholder: Option<String>, view_rows: u16, ) -> Self
pub fn core(&self) -> &CoreSessionState
pub fn core_mut(&mut self) -> &mut CoreSessionState
pub fn handle_command(&mut self, command: InlineCommand)
Methods from Deref<Target = CoreSessionState>§
pub fn header_block_title(&self) -> Line<'static>
pub fn header_title_line(&self) -> Line<'static>
pub fn header_mode_short_label(&self) -> String
pub fn header_provider_short_value(&self) -> String
pub fn header_model_short_value(&self) -> String
pub fn header_reasoning_short_value(&self) -> String
pub fn header_chain_values(&self) -> Vec<String>
pub fn header_meta_line(&self) -> Line<'static>
pub fn handle_event( &mut self, event: CrosstermEvent, events: &UnboundedSender<InlineEvent>, callback: Option<&(dyn Fn(&InlineEvent) + Send + Sync + 'static)>, )
pub fn cursor(&self) -> usize
pub fn set_input(&mut self, text: impl Into<String>)
pub fn set_cursor(&mut self, pos: usize)
pub fn process_key(&mut self, key: KeyEvent) -> Option<InlineEvent>
pub fn handle_command(&mut self, command: InlineCommand)
pub fn apply_view_rows(&mut self, rows: u16)
pub fn set_log_receiver(&mut self, receiver: UnboundedReceiver<LogEntry>)
pub fn render(&mut self, frame: &mut Frame<'_>)
pub fn scroll_offset(&self) -> usize
pub fn default_style(&self) -> InlineTextStyle
Sourcepub fn build_input_widget_data(
&self,
width: u16,
height: u16,
) -> InputWidgetData
pub fn build_input_widget_data( &self, width: u16, height: u16, ) -> InputWidgetData
Build input render data for external widgets
Sourcepub fn build_input_status_widget_data(
&self,
width: u16,
) -> Option<Vec<Span<'static>>>
pub fn build_input_status_widget_data( &self, width: u16, ) -> Option<Vec<Span<'static>>>
Build input status line for external widgets
Sourcepub fn insert_paste_text(&mut self, text: &str)
pub fn insert_paste_text(&mut self, text: &str)
Insert pasted text without enforcing the inline newline cap.
This preserves the full block (including large multi-line pastes) so the agent receives the exact content instead of dropping line breaks after hitting the interactive input’s visual limit.
Sourcepub fn history_position(&self) -> Option<(usize, usize)>
pub fn history_position(&self) -> Option<(usize, usize)>
Returns the current history position for status bar display Returns (current_index, total_entries) or None if not navigating history
Sourcepub fn should_exit(&self) -> bool
pub fn should_exit(&self) -> bool
Check if the session should exit
Sourcepub fn request_exit(&mut self)
pub fn request_exit(&mut self)
Request session exit
Sourcepub fn take_redraw(&mut self) -> bool
pub fn take_redraw(&mut self) -> bool
Take the redraw flag and reset it
Returns true if a redraw was needed
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark the session as needing a redraw
Sourcepub fn invalidate_header_cache(&mut self)
pub fn invalidate_header_cache(&mut self)
Invalidate only the header cache (e.g. when provider/model changes)
Invalidate only the sidebar cache (e.g. when queue changes)
Sourcepub fn handle_tick(&mut self)
pub fn handle_tick(&mut self)
Advance animation state on tick and request redraw when a frame changes.
Sourcepub fn scroll_line_up(&mut self)
pub fn scroll_line_up(&mut self)
Scroll operations
Note: The scroll offset model is inverted for chat-style display: offset=0 shows the bottom (newest content), offset=max shows the top. Therefore “scroll up” (show older content) increases the offset, and “scroll down” (show newer content) decreases it.
pub fn scroll_line_down(&mut self)
Sourcepub fn set_workspace_root(&mut self, workspace_root: Option<PathBuf>)
pub fn set_workspace_root(&mut self, workspace_root: Option<PathBuf>)
Set the workspace root path for dynamic title generation
Sourcepub fn update_terminal_title(&mut self)
pub fn update_terminal_title(&mut self)
Update the terminal title if it has changed.
Sourcepub fn clear_terminal_title(&mut self)
pub fn clear_terminal_title(&mut self)
Clear terminal title (reset to default)
Trait Implementations§
Source§impl Deref for AppSession
impl Deref for AppSession
Source§impl DerefMut for AppSession
impl DerefMut for AppSession
Source§impl TuiSessionDriver for AppSession
impl TuiSessionDriver for AppSession
type Command = InlineCommand
type Event = InlineEvent
fn handle_command(&mut self, command: Self::Command)
fn handle_event( &mut self, event: CrosstermEvent, events: &UnboundedSender<Self::Event>, callback: Option<&(dyn Fn(&Self::Event) + Send + Sync + 'static)>, )
fn handle_tick(&mut self)
fn render(&mut self, frame: &mut Frame<'_>)
fn take_redraw(&mut self) -> bool
fn use_steady_cursor(&self) -> bool
fn should_exit(&self) -> bool
fn request_exit(&mut self)
fn mark_dirty(&mut self)
fn update_terminal_title(&mut self)
fn clear_terminal_title(&mut self)
fn is_running_activity(&self) -> bool
fn has_status_spinner(&self) -> bool
fn thinking_spinner_active(&self) -> bool
fn apply_coalesced_scroll(&mut self, line_delta: i32, page_delta: i32)
fn set_show_logs(&mut self, show: bool)
fn set_active_pty_sessions(&mut self, sessions: Option<Arc<AtomicUsize>>)
fn set_workspace_root(&mut self, root: Option<PathBuf>)
fn set_log_receiver(&mut self, receiver: UnboundedReceiver<LogEntry>)
Auto Trait Implementations§
impl Freeze for AppSession
impl RefUnwindSafe for AppSession
impl Send for AppSession
impl Sync for AppSession
impl Unpin for AppSession
impl UnsafeUnpin for AppSession
impl UnwindSafe for AppSession
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> 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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more