ssh: rename use_multiplexer to multiplexing

This puts us in a better position for the future to be able
to configure whether we use wezterm, tmux or no multiplexing.

Today we allow wezterm or no multiplexing.

Add docs on this new setting.

refs: https://github.com/wez/wezterm/issues/1456
This commit is contained in:
Wez Furlong committed 2022-01-09 19:16:54 -07:00
1 parent f84c0632d8
commit 3593a288ea
3 files changed
+45 -5

No files matched your search

+16 -2
View File
@@ -15,6 +15,20 @@ impl Default for SshBackend {
}
}
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)]
pub enum SshMultiplexing {
WezTerm,
None,
// TODO: Tmux-cc in the future?
}
impl_lua_conversion!(SshMultiplexing);
impl Default for SshMultiplexing {
fn default() -> Self {
Self::WezTerm
}
}
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
pub struct SshDomain {
/// The name of this specific domain. Must be unique amongst
@@ -47,8 +61,8 @@ pub struct SshDomain {
/// just connect directly using ssh. This doesn't require
/// that the remote host have wezterm installed, and is equivalent
/// to using `wezterm ssh` to connect.
#[serde(default = "default_true")]
pub use_multiplexer: bool,
#[serde(default)]
pub multiplexing: SshMultiplexing,
/// ssh_config option values
#[serde(default)]
+26
View File
@@ -54,3 +54,29 @@ return {
}
```
*Since: nightly builds only*
You may now specify the type of `multiplexing` used by an ssh domain.
The following values are possible:
* `"WezTerm"` - this is the default; use wezterm's multiplexing client.
Having wezterm installed on the server is required to use this mode.
* `"None"` - don't use any multiplexing. The connection is an ssh connection
using the same mechanism as is used by `wezterm ssh`; losing connectivity
will lose any panes/tabs. This mode of operation is convenient when using
SSH to connect automatically into eg: a locally hosted WSL instance, together
with the [default_domain](config/default_domain.md) option.
```lua
return {
ssh_domains = {
{
name = "my.server",
remote_address = "192.168.1.1",
multiplexing = "None",
}
},
default_domain = "my.server",
}
```
+3 -3
View File
@@ -3,7 +3,7 @@
use ::window::*;
use anyhow::{anyhow, Context};
use config::{ConfigHandle, SshBackend};
use config::{ConfigHandle, SshBackend, SshMultiplexing};
use mux::activity::Activity;
use mux::domain::{Domain, LocalDomain};
use mux::ssh::RemoteSshDomain;
@@ -211,7 +211,7 @@ fn client_domains(config: &config::ConfigHandle) -> Vec<ClientDomainConfig> {
}
for ssh_dom in &config.ssh_domains {
if ssh_dom.use_multiplexer {
if ssh_dom.multiplexing == SshMultiplexing::WezTerm {
domains.push(ClientDomainConfig::Ssh(ssh_dom.clone()));
}
}
@@ -334,7 +334,7 @@ fn update_mux_domains(config: &ConfigHandle) -> anyhow::Result<()> {
}
for ssh_dom in &config.ssh_domains {
if ssh_dom.use_multiplexer {
if ssh_dom.multiplexing != SshMultiplexing::None {
continue;
}