Skip to main content

Module bash_executor

Module bash_executor 

Source
Expand description

User ! commands: run in the shell, stream sanitized output, keep the tail.

Port of packages/coding-agent/src/core/bash-executor.ts in pi v1.0.0.

Structs§

BashResult
What a user ! command produced: the bash response data.

Functions§

execute
Runs command in cwd with the configured shell, calling on_chunk with each sanitized piece of output, until it exits or cancel fires.
execute_with
pi’s executeBashWithOperations: runs a command through exec, which sends its output to the sender it gets and returns the exit code, and collects the output as execute does. A run that fails or ends after cancel fired is cancelled.
sanitize_binary
pi’s sanitizeBinaryOutput: drops control characters other than tab, newline and carriage return, and Unicode interlinear annotations.
strip_ansi
pi’s stripAnsi: removes OSC (operating system command) and CSI (control sequence introducer) sequences.