diff options
| -rw-r--r-- | docs/next/website/src/content/docs/connecting-machines.mdx | 2 | ||||
| -rw-r--r-- | src/remote/attach.rs | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/docs/next/website/src/content/docs/connecting-machines.mdx b/docs/next/website/src/content/docs/connecting-machines.mdx index 0e553552..3f7bcfe6 100644 --- a/docs/next/website/src/content/docs/connecting-machines.mdx +++ b/docs/next/website/src/content/docs/connecting-machines.mdx @@ -7,6 +7,8 @@ Keep your local work and remote agents in one Herdr window. Save an SSH machine Each machine keeps its own Herdr server, sessions, and running processes. A lost connection to one machine does not disconnect the others. +Herdr requests SSH compression to reduce screen-update traffic on limited connections. This works with older compatible Herdr servers and does not change how typing or other input is delivered. Herdr's `-C` option overrides `Compression no` in your SSH config. If SSH reuses an existing connection through an external ControlMaster, that connection keeps its original compression setting. + ## Before you connect You need normal SSH access to the remote machine. Verify it first: diff --git a/src/remote/attach.rs b/src/remote/attach.rs index 53023b83..8e0950b9 100644 --- a/src/remote/attach.rs +++ b/src/remote/attach.rs @@ -1045,6 +1045,8 @@ fn apply_noninteractive_ssh_options(command: &mut Command) { } fn apply_managed_ssh_options(command: &mut Command, options: Option<&ManagedSshOptions>) { + // Compress the first connection too: multiplexed bridges inherit the master's transport. + command.arg("-C"); let Some(options) = options else { return; }; @@ -1062,6 +1064,7 @@ fn apply_managed_ssh_options(command: &mut Command, options: Option<&ManagedSshO } fn apply_managed_scp_options(command: &mut Command, options: Option<&ManagedSshOptions>) { + command.arg("-C"); let Some(options) = options else { return; }; @@ -3623,6 +3626,7 @@ mod tests { assert_eq!( args, vec![ + "-C".to_string(), "-F".to_string(), config_path.to_string_lossy().into_owned(), "-S".to_string(), @@ -3644,6 +3648,7 @@ mod tests { assert_eq!( scp_args, vec![ + "-C".to_string(), "-F".to_string(), config_path.to_string_lossy().into_owned(), "-o".to_string(), @@ -3690,6 +3695,7 @@ mod tests { assert_eq!( args, vec![ + "-C".to_string(), "-F".to_string(), config_path.to_string_lossy().into_owned(), "-T".to_string(), @@ -3703,7 +3709,11 @@ mod tests { .collect::<Vec<_>>(); assert_eq!( scp_args, - vec!["-F".to_string(), config_path.to_string_lossy().into_owned(),] + vec![ + "-C".to_string(), + "-F".to_string(), + config_path.to_string_lossy().into_owned(), + ] ); } @@ -3747,6 +3757,7 @@ mod tests { .map(|arg| arg.to_string_lossy().into_owned()) .collect::<Vec<_>>(); for required in [ + "-C", "BatchMode=yes", "NumberOfPasswordPrompts=0", "StrictHostKeyChecking=yes", @@ -3842,7 +3853,7 @@ mod tests { } #[test] - fn remote_ssh_command_is_plain_without_managed_config() { + fn remote_ssh_commands_compress_without_managed_config() { let ssh = RemoteSsh { target: "example".to_string(), session_name: crate::session::DEFAULT_SESSION_NAME.into(), @@ -3856,8 +3867,8 @@ mod tests { .map(|arg| arg.to_string_lossy().into_owned()) .collect::<Vec<_>>(); - assert_eq!(args, vec!["-T".to_string(), "example".to_string()]); - assert!(ssh.scp_command().get_args().next().is_none()); + assert_eq!(args, vec!["-C", "-T", "example"]); + assert_eq!(ssh.scp_command().get_args().collect::<Vec<_>>(), vec!["-C"]); } #[test] |
