Skip to main content

ShellConfig

Struct ShellConfig 

Source
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: ShellExitAction

Action 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: StartupDirectoryMode

Startup 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: bool

Whether 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: String

Text 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: u64

Delay in milliseconds before sending the initial text (to allow shell to be ready)

§initial_text_send_newline: bool

Whether to append a newline after sending the initial text

§answerback_string: String

Answerback 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: bool

Show 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: bool

Show 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: bool

Show 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

Trait Implementations§

Source§

impl Clone for ShellConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShellConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ShellConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ShellConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ShellConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.