pub struct ScriptConfig {Show 15 fields
pub name: String,
pub enabled: bool,
pub script_path: String,
pub args: Vec<String>,
pub auto_start: bool,
pub restart_policy: RestartPolicy,
pub restart_delay_ms: u64,
pub subscriptions: Vec<String>,
pub env_vars: HashMap<String, String>,
pub allow_write_text: bool,
pub prompt_before_write_text: bool,
pub allow_run_command: bool,
pub allow_change_config: bool,
pub write_text_rate_limit: u32,
pub run_command_rate_limit: u32,
}Expand description
Configuration for an external observer script that receives terminal events via JSON protocol.
Fields§
§name: StringHuman-readable name for this script
enabled: boolWhether this script is enabled (default: true)
script_path: StringPath to the script executable
args: Vec<String>Arguments to pass to the script
auto_start: boolWhether to start this script automatically when a tab opens
restart_policy: RestartPolicyPolicy for restarting the script when it exits
restart_delay_ms: u64Delay in milliseconds before restarting (when restart_policy is not Never)
subscriptions: Vec<String>Event types to subscribe to (empty = all events)
env_vars: HashMap<String, String>Additional environment variables to set for the script process
allow_write_text: boolAllow this script to inject text into the active PTY via WriteText.
Defaults to false. Must be explicitly set to true to enable.
When enabled, VT/ANSI escape sequences are stripped before writing
and a rate limit is applied (see write_text_rate_limit).
prompt_before_write_text: boolAsk before each WriteText injection from this script.
Defaults to true, mirroring prompt_before_run on triggers. Stripping
escape sequences does not make an injection safe — the payload that runs
a command is ordinary printable text plus a newline — so confirmation,
not filtering, is the control on this path. Set to false to write
immediately; the write is still sanitized and rate limited.
allow_run_command: boolAllow this script to spawn external processes via RunCommand.
Defaults to false. Must be explicitly set to true to enable.
When enabled, the command is checked against the denylist and a
rate limit is applied (see run_command_rate_limit).
allow_change_config: boolAllow this script to modify runtime configuration via ChangeConfig.
Defaults to false. Must be explicitly set to true to enable.
Only keys in the runtime allowlist may be changed.
write_text_rate_limit: u32Maximum WriteText writes per second (0 = use default of 10/s).
run_command_rate_limit: u32Maximum RunCommand executions per second (0 = use default of 1/s).
Implementations§
Source§impl ScriptConfig
impl ScriptConfig
Sourcepub fn should_auto_start(&self) -> bool
pub fn should_auto_start(&self) -> bool
Whether this script should be started automatically when a tab is created.
A script auto-starts only when it is both enabled and opted in via
auto_start; enabled: false disables the script entirely, including
auto-start, matching the manual start path in the Settings UI.