1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

ssh: allow selecting libssh or ssh2 backend via config

Pass this via the ssh option overrides:

```
wezterm ssh -o wezterm_ssh_backend=libssh hostname
```
This commit is contained in:
Wez Furlong 2021-10-18 08:13:28 -07:00
parent 1f073db776
commit a6022f5c65

View File

@ -63,10 +63,17 @@ impl SessionInner {
}
fn run_impl(&mut self) -> anyhow::Result<()> {
if true {
self.run_impl_libssh()
} else {
self.run_impl_ssh2()
let backend = self
.config
.get("wezterm_ssh_backend")
.map(|s| s.as_str())
.unwrap_or("ssh2");
match backend {
"ssh2" => self.run_impl_ssh2(),
"libssh" => self.run_impl_libssh(),
_ => anyhow::bail!(
"invalid wezterm_ssh_backend value: {}, expected either `ssh2` or `libssh`"
),
}
}