Module shellexec

Module shellexec 

Source
Expand description

Shell process execution: PTY management and process lifecycle. Port of Go’s pkg/shellexec/shellexec.go + conninterface.go.

Uses a trait-based abstraction (ConnInterface) so that:

  • Real PTY implementations can use portable-pty or platform APIs
  • Tests can use mock implementations
  • SSH/WSL connections implement the same interface

Structs§

CommandOpts
Options for shell command execution. Port of Go’s shellexec.CommandOptsType.
MockConn
Mock ConnInterface for testing without a real PTY.
ShellProc
A running shell process wrapping a ConnInterface. Port of Go’s shellexec.ShellProc.

Constants§

BLOCK_FILE_CACHE
BLOCK_FILE_ENV
BLOCK_FILE_TERM
Block file name constants (match Go’s base.BlockFile_*).
CONN_TYPE_LOCAL
Connection type constants (match Go’s conncontroller types).
CONN_TYPE_SSH
CONN_TYPE_WSL
DEFAULT_HTML_MAX_FILE_SIZE
Default max file size for HTML content (256KB).
DEFAULT_TERM_COLS
Default terminal columns (matches Go’s shellutil.DefaultTermCols).
DEFAULT_TERM_MAX_FILE_SIZE
Default max file size for terminal circular buffer (256KB).
DEFAULT_TERM_ROWS
Default terminal rows (matches Go’s shellutil.DefaultTermRows).
MAX_INIT_SCRIPT_SIZE
Max init script size (50KB).

Traits§

ConnInterface
Abstraction over a PTY-connected process. Port of Go’s shellexec.ConnInterface which embeds pty.Pty.

Functions§

build_wave_env
Build standard AGENTMUX_* environment variables.
default_term_size
Get the default TermSize.
detect_shell_type
Determine the shell type from a shell path. Returns one of: “bash”, “zsh”, “fish”, “pwsh”, “unknown”.