Fix SSH remotes running Nushell (#25613)

- Closes: https://github.com/zed-industries/zed/issues/21005

Nushell does not support `uname -sm`
So invoke `sh -c "uname -sm"` instead which will also work under nushell.
See https://github.com/nushell/nushell/issues/12570 for the choice quote: "being posix/bash compliant is a non-goal"

Release Notes:

- Fixed ssh remotes running Nushell
This commit is contained in:
Peter Tripp 2025-03-05 10:50:32 -05:00 committed by GitHub
parent e600e71c1c
commit 2d050a8130
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1634,7 +1634,7 @@ impl SshRemoteConnection {
}
async fn platform(&self) -> Result<SshPlatform> {
let uname = self.socket.run_command("uname", &["-sm"]).await?;
let uname = self.socket.run_command("sh", &["-c", "uname -sm"]).await?;
let Some((os, arch)) = uname.split_once(" ") else {
Err(anyhow!("unknown uname: {uname:?}"))?
};