diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-20 00:29:53 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-20 00:34:27 +0300 |
| commit | 2b97799b6715fd6c355db9c225029765971915e6 (patch) | |
| tree | cb7c2c7093f439ad3460687b88c3e6cf539b64e8 /src/config/model.rs | |
| parent | ff8e5a14abe445a61dc200fd30a70870c75d183c (diff) | |
feat: add configurable default shell
refs #196
Diffstat (limited to 'src/config/model.rs')
| -rw-r--r-- | src/config/model.rs | 21 |
1 files changed, 21 insertions, 0 deletions
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<bool>, pub theme: ThemeConfig, + pub terminal: TerminalConfig, pub keys: KeysConfig, pub ui: UiConfig, pub advanced: AdvancedConfig, @@ -298,6 +306,19 @@ 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#" [ui] |
