Support SSH aliases in Dosh client installs
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
Codex
2026-06-11 08:46:24 -04:00
parent 6cfba5329d
commit 12beb04d4d
6 changed files with 19 additions and 17 deletions
+6 -3
View File
@@ -80,7 +80,7 @@ async fn main() -> Result<()> {
"read-write"
}
.to_string();
let ssh_port = args.ssh_port.unwrap_or(config.ssh_port);
let ssh_port = args.ssh_port.or(config.ssh_port);
let dosh_port = args.dosh_port.unwrap_or(config.dosh_port);
let cache_path = cache_path(&config.credential_cache, &server, &session, &mode);
let (cols, rows) = size().unwrap_or((80, 24));
@@ -232,7 +232,7 @@ fn local_bootstrap(
fn ssh_bootstrap(
server: &str,
ssh_port: u16,
ssh_port: Option<u16>,
ssh_auth_command: &str,
ssh_key: Option<&std::path::Path>,
ssh_known_hosts: Option<&std::path::Path>,
@@ -246,7 +246,10 @@ fn ssh_bootstrap(
let nonce_b64 = URL_SAFE_NO_PAD.encode(nonce);
let size = format!("{cols}x{rows}");
let mut command = Command::new("ssh");
command.arg("-p").arg(ssh_port.to_string()).arg("-T");
if let Some(ssh_port) = ssh_port {
command.arg("-p").arg(ssh_port.to_string());
}
command.arg("-T");
if let Some(key) = ssh_key {
command.arg("-i").arg(key);
}