{"record":{"id":"b711b098d4c5bf1d","repo":"zed-industries/zed","slug":"cannot-open-multiple-different-remote-connections","errorCode":null,"errorMessage":"cannot open multiple different remote connections","messagePattern":"cannot open multiple different remote connections","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zed/src/zed/open_listener.rs","lineNumber":313,"sourceCode":"        let username = if url.username().is_empty() {\n            None\n        } else {\n            Some(urlencoding::decode(url.username())?.into_owned())\n        };\n        let port = url.port();\n        anyhow::ensure!(\n            self.open_paths.is_empty(),\n            \"cannot open both local and ssh paths\"\n        );\n        let mut connection_options =\n            RemoteSettings::get_global(cx).connection_options_for(host, port, username);\n        if let Some(password) = url.password() {\n            connection_options.password = Some(urlencoding::decode(password)?.into_owned());\n        }\n\n        let connection_options = RemoteConnectionOptions::Ssh(connection_options);\n        if let Some(ssh_connection) = &self.remote_connection {\n            anyhow::ensure!(\n                *ssh_connection == connection_options,\n                \"cannot open multiple different remote connections\"\n            );\n        }\n        self.remote_connection = Some(connection_options);\n        self.parse_file_path(url.path());\n        Ok(())\n    }\n}\n\nfn parse_ssh_url(url: &str) -> Result<url::Url> {\n    if let Ok(url) = url::Url::parse(url) {\n        return Ok(url);\n    }\n    // SCP/git style urls use ':' to separate from Authority and Path.\n    // They are unsupported by Url::parse, but can be normalized into a Url.\n    //   SCPUrl(\"ssh://user@host:~/relpath\") => Url(\"ssh://user@host/~/relpath\")\n    //   SCPUrl(\"ssh://user@host:/abs/path\") => Url(\"ssh://user@host/abs/path\")","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/zed/src/zed/open_listener.rs#L295-L331","documentation":"Raised in parse_ssh_file_path (or the surrounding open-request parser) when the request already references a different remote host/connection. Zed can only open files over one remote connection per request; a second, different connection is rejected.","triggerScenarios":"Thrown at crates/zed/src/zed/open_listener.rs:313 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open each SSH host in its own window/session"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}