diff --git a/src/session/config.rs b/src/session/config.rs index cdf3d17..6a16e04 100644 --- a/src/session/config.rs +++ b/src/session/config.rs @@ -30,7 +30,7 @@ pub struct Session { pub passphrase: String, #[serde(default)] pub last_used: Option, - #[serde(default)] + #[serde(default = "default_global_proxy_type")] pub proxy_type: String, // "none", "socks5", "http" #[serde(default)] pub proxy_host: String, diff --git a/src/session/mod.rs b/src/session/mod.rs index 0ecfddb..f5af267 100644 --- a/src/session/mod.rs +++ b/src/session/mod.rs @@ -198,7 +198,11 @@ impl Ashell { window, cx, ); - self.ssh_proxy_type = session.proxy_type.clone(); + self.ssh_proxy_type = if session.proxy_type.is_empty() { + "none".to_string() + } else { + session.proxy_type.clone() + }; Self::set_input_value(&self.proxy_host_input, session.proxy_host.clone(), window, cx); Self::set_input_value( &self.proxy_port_input,