From 2b97799b6715fd6c355db9c225029765971915e6 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Wed, 20 May 2026 00:29:53 +0300 Subject: feat: add configurable default shell refs #196 --- src/config/model.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/config/model.rs') diff --git a/src/config/model.rs b/src/config/model.rs index 673eec02..ff3a7b22 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -34,6 +34,13 @@ pub struct ToastConfig { pub delivery: ToastDelivery, } +#[derive(Debug, Default, Deserialize)] +#[serde(default)] +pub struct TerminalConfig { + /// Executable used for new interactive panes. Empty means SHELL, then /bin/sh. + pub default_shell: String, +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] #[serde(rename_all = "snake_case")] pub enum ConfigReloadStatus { @@ -66,6 +73,7 @@ pub fn validated_sidebar_bounds(min: u16, max: u16) -> Option<(u16, u16)> { pub struct Config { pub onboarding: Option, pub theme: ThemeConfig, + pub terminal: TerminalConfig, pub keys: KeysConfig, pub ui: UiConfig, pub advanced: AdvancedConfig, @@ -297,6 +305,19 @@ impl Default for AdvancedConfig { mod tests { use super::*; + #[test] + fn terminal_default_shell_defaults_empty_and_parses() { + let default_config = Config::default(); + assert!(default_config.terminal.default_shell.is_empty()); + + let toml = r#" +[terminal] +default_shell = "nu" +"#; + let config: Config = toml::from_str(toml).unwrap(); + assert_eq!(config.terminal.default_shell, "nu"); + } + #[test] fn agent_panel_scope_config_parses() { let toml = r#" -- cgit v1.2.3