Add SSH port forwards to settings (#24474)

Closes #6920

Release Notes:

- Added ability to specify port forwarding settings for remote
connections
This commit is contained in:
Richard Weber 2025-02-14 23:52:24 +02:00 committed by GitHub
parent 58b0a6c4af
commit 5f6311171f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 158 additions and 6 deletions

View file

@ -878,6 +878,7 @@ impl RemoteServerProjects {
nickname: None,
args: connection_options.args.unwrap_or_default(),
upload_binary_over_ssh: None,
port_forwards: connection_options.port_forwards,
})
});
}

View file

@ -15,7 +15,7 @@ use gpui::{
use language::CursorShape;
use markdown::{Markdown, MarkdownStyle};
use release_channel::ReleaseChannel;
use remote::ssh_session::ConnectionIdentifier;
use remote::ssh_session::{ConnectionIdentifier, SshPortForwardOption};
use remote::{SshConnectionOptions, SshPlatform, SshRemoteClient};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@ -52,6 +52,7 @@ impl SshSettings {
host,
port,
username,
port_forwards: conn.port_forwards,
password: None,
};
}
@ -86,6 +87,9 @@ pub struct SshConnection {
// limited outbound internet access.
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_binary_over_ssh: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub port_forwards: Option<Vec<SshPortForwardOption>>,
}
impl From<SshConnection> for SshConnectionOptions {
@ -98,6 +102,7 @@ impl From<SshConnection> for SshConnectionOptions {
args: Some(val.args),
nickname: val.nickname,
upload_binary_over_ssh: val.upload_binary_over_ssh.unwrap_or_default(),
port_forwards: val.port_forwards,
}
}
}