pub struct ShellConfig {Show 17 fields
pub shell_exit_action: ShellExitAction,
pub custom_shell: Option<String>,
pub shell_args: Option<Vec<String>>,
pub working_directory: Option<String>,
pub startup_directory_mode: StartupDirectoryMode,
pub startup_directory: Option<String>,
pub last_working_directory: Option<String>,
pub shell_env: Option<HashMap<String, String>>,
pub login_shell: bool,
pub initial_text: String,
pub initial_text_delay_ms: u64,
pub initial_text_send_newline: bool,
pub answerback_string: String,
pub prompt_on_quit: bool,
pub confirm_close_multiple_tabs: bool,
pub confirm_close_running_jobs: bool,
pub jobs_to_ignore: Vec<String>,
}Expand description
Which shell runs, where it starts, what it is sent, and what happens when it exits.
Fields§
§shell_exit_action: ShellExitActionAction to take when the shell process exits Supports: close, keep, restart_immediately, restart_with_prompt, restart_after_delay For backward compatibility, also accepts boolean values (true=close, false=keep)
custom_shell: Option<String>Custom shell command (defaults to system shell if not specified)
shell_args: Option<Vec<String>>Arguments to pass to the shell
working_directory: Option<String>Working directory for the shell (legacy, use startup_directory_mode instead) When set, overrides startup_directory_mode for backward compatibility
startup_directory_mode: StartupDirectoryModeStartup directory mode: controls where new sessions start
- home: Start in user’s home directory (default)
- previous: Remember and restore last working directory from previous session
- custom: Start in the directory specified by startup_directory
startup_directory: Option<String>Custom startup directory (used when startup_directory_mode is “custom”) Supports ~ for home directory expansion
last_working_directory: Option<String>Last working directory from previous session (auto-managed) Used when startup_directory_mode is “previous”
shell_env: Option<HashMap<String, String>>Environment variables to set for the shell
login_shell: boolWhether to spawn the shell as a login shell (passes -l flag) This is important on macOS to properly initialize PATH from Homebrew, /etc/paths.d, etc. Default: true
initial_text: StringText to send automatically when a terminal session starts Supports escape sequences: \n (newline), \r (carriage return), \t (tab), \xHH (hex), \e (ESC)
initial_text_delay_ms: u64Delay in milliseconds before sending the initial text (to allow shell to be ready)
initial_text_send_newline: boolWhether to append a newline after sending the initial text
answerback_string: StringAnswerback string sent in response to ENQ (0x05) control character This is a legacy terminal feature used for terminal identification. Default: empty (disabled) for security Common values: “par-term”, “vt100”, or custom identification Security note: Setting this may expose terminal identification to applications
prompt_on_quit: boolShow confirmation dialog before quitting the application
When enabled, closing the window will show a confirmation dialog
if there are any open terminal sessions. Only applies when
confirm_close_multiple_tabs is off — with the multi-tab guard
on, only a multi-tab close asks (D6, iTerm2 alignment).
Default: true
confirm_close_multiple_tabs: boolShow confirmation dialog before closing a window that holds more than one tab. A single-tab window closes silently — the session-undo window (5 s, shell preserved) can restore the tab. Default: true
confirm_close_running_jobs: boolShow confirmation dialog before closing a tab with running jobs When enabled, closing a tab that has a running command will show a confirmation dialog. Default: false (close immediately without confirmation)
jobs_to_ignore: Vec<String>List of job/process names to ignore when checking for running jobs These jobs will not trigger a close confirmation dialog. Common examples: “bash”, “zsh”, “fish”, “cat”, “less”, “man”, “sleep” Default: common shell names that shouldn’t block tab close