Skip to main content

Module pty

Module pty 

Source
Expand description

PTY-backed process APIs.

Modules§

backend
Cross-platform PTY backend traits and platform-selected implementations. Host-neutral PTY facade owned by running-process-platform-internal.
reexportsDeprecated
Compatibility re-exports for downstream crates using the pre-boundary PTY API.
terminal_input
Native terminal input capture and translation helpers. Native terminal input capture routed through the platform boundary.

Structs§

ChildProcessInfo
Information about a child process found via Toolhelp snapshot.
IdleDetectorCore
Core idle detection logic, shareable across threads via Arc. The reader thread calls record_output directly.
IdleMonitorState
Shared mutable state for idle detection waits.
InteractivePtyOptions
Re-exported native PTY process and interactive session types. Safe defaults for a real interactive PTY session.
InteractivePtyPumpResult
Re-exported native PTY process and interactive session types. Output collected by one interactive PTY pump operation.
InteractivePtySession
Re-exported native PTY process and interactive session types. Canonical interactive PTY recipe for downstream Rust consumers.
NativePtyHandles
NativePtyProcess
Re-exported native PTY process and interactive session types. Low-level native pseudo-terminal process wrapper.
OrphanConhostInfo
A conhost.exe process whose parent is no longer alive — likely an orphan from a dead ConPTY session.
PtyReadShared
Shared reader state paired with a condition variable for waiters.
PtyReadState
Buffered output and close state for a PTY reader thread.
PtySize
Re-exported PTY backend handles and size type. Caller-facing PTY dimensions.

Enums§

ConPtyBackendKind
Reports whether the process-wide ConPTY API table resolved to the system kernel32.dll or to a sidecar conpty.dll. See #443.
PtyError
Errors returned by pseudo-terminal process operations.

Traits§

PtyChild
Re-exported PTY backend handles and size type. Platform-neutral handle for a child process running inside a PTY.
PtyMaster
Re-exported PTY backend handles and size type. Platform-neutral handle for the master side of a pseudo-terminal.

Functions§

command_builder_from_argvDeprecated
Build a portable_pty::CommandBuilder from an argv vector.
control_churn_bytes
Count ANSI/control bytes that should not be treated as visible output.
current_backend_kind
Reports whether the process-wide ConPTY API table resolved to the system kernel32.dll or to a sidecar conpty.dll. See #443.
find_child_processes
Find all direct child processes of a given parent PID using the Windows Toolhelp API. Returns PID and process name for each child.
find_orphan_conhosts
Scan all conhost.exe processes on the system and return those whose parent process is no longer alive. These are likely orphans from dead ConPTY sessions.
input_contains_newline
Return whether input bytes contain a carriage return or newline.
is_ignorable_process_control_error
Return whether a process-control error can be ignored during cleanup.
platform_shell_argv
Build an argv for the selected host shell.
poll_pty_process
Poll the PTY child process and persist its return code after exit.
portable_exit_codeDeprecated
Convert a portable_pty exit status into this crate’s signed exit-code convention.
record_pty_input_metrics
Record PTY input byte, newline, and submit counters for one input chunk.
spawn_pty_reader
Spawn the background reader that drains PTY output into shared state.
store_pty_returncode
Store the PTY child return code in shared process state.
wait_before_close_supported
Whether this host can observe child exit before closing the PTY master.
windows_terminal_input_payload
Translate newline bytes into the Windows PTY input payload format.
write_pty_input
Write input bytes to the running PTY after platform-specific translation.

Type Aliases§

SharedPtyWriter
Platform-neutral handles for a running native PTY child. Independently-lockable PTY input writer (issue #590, cluster D). Kept separate from the handles mutex so a blocking write never holds that lock — see the field docs on NativePtyHandles::writer.
WindowsJobHandle
Compatibility name for the host-owned PTY process-tree guard.