pub struct PtyManager { /* private fields */ }Implementations§
Source§impl PtyManager
impl PtyManager
pub fn list_sessions(&self) -> Vec<VTCodePtySession>
pub fn snapshot_session(&self, session_id: &str) -> Result<VTCodePtySession>
pub fn read_session_output( &self, session_id: &str, drain: bool, ) -> Result<Option<String>>
Sourcepub fn is_output_drained(&self, session_id: &str) -> Result<bool>
pub fn is_output_drained(&self, session_id: &str) -> Result<bool>
Check if all output from this PTY session has been consumed.
pub fn send_input_to_session( &self, session_id: &str, data: &[u8], append_newline: bool, ) -> Result<usize>
pub fn resize_session( &self, session_id: &str, size: PtySize, ) -> Result<VTCodePtySession>
pub fn is_session_completed(&self, session_id: &str) -> Result<Option<i32>>
pub fn terminate_session(&self, session_id: &str) -> Result<()>
pub fn force_terminate_session(&self, session_id: &str) -> Result<()>
Sourcepub async fn sync_sessions_to_files(&self) -> Result<Vec<PathBuf>>
pub async fn sync_sessions_to_files(&self) -> Result<Vec<PathBuf>>
Sync all terminal sessions to files for dynamic context discovery
This implements Cursor-style dynamic context discovery:
- Each terminal session is written to
.vtcode/terminals/{session_id}.txt - Includes metadata header (cwd, last command, exit code)
- Agent can reference terminal output via grep/read_file
Sourcepub fn terminals_dir(&self) -> PathBuf
pub fn terminals_dir(&self) -> PathBuf
Get the terminals directory path
pub fn close_session(&self, session_id: &str) -> Result<VTCodePtySession>
pub fn close_session_with_mode( &self, session_id: &str, mode: PtyCloseMode, ) -> Result<VTCodePtySession>
pub fn terminate_all_sessions(&self)
pub fn terminate_all_sessions_with_mode(&self, mode: PtyCloseMode)
Source§impl PtyManager
impl PtyManager
pub fn new(workspace_root: PathBuf, config: PtyConfig) -> Self
pub fn with_audit_log( self, audit_log: Arc<TokioMutex<PermissionAuditLog>>, ) -> Self
pub fn config(&self) -> &PtyConfig
pub fn apply_commands_config(&self, commands_config: &CommandsConfig)
pub fn describe_working_dir(&self, path: &Path) -> String
pub async fn run_command( &self, request: PtyCommandRequest, ) -> Result<PtyCommandResult>
pub async fn resolve_working_dir( &self, requested: Option<&str>, ) -> Result<PathBuf>
pub fn create_session( &self, session_id: String, command: Vec<String>, working_dir: PathBuf, size: PtySize, ) -> Result<VTCodePtySession>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PtyManager
impl !UnwindSafe for PtyManager
impl Forget for PtyManager
impl Freeze for PtyManager
impl Move for PtyManager
impl Send for PtyManager
impl Sync for PtyManager
impl Unpin for PtyManager
impl UnsafeUnpin for PtyManager
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
Mutably borrows from an owned value. Read more
impl<T> CacheValue for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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<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> 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> ⓘ
Converts
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> ⓘ
Converts
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