SSH remoting: terminal & tasks (#15321)
This also rolls back the `TerminalWorkDir` abstraction I added for the original remoting, and tidies up the terminal creation code to be clear about whether we're creating a task *or* a terminal. The previous logic was a little muddy because it assumed we could be doing both at the same time (which was not true). Release Notes: - remoting alpha: Removed the ability to specify `gh cs ssh` or `gcloud compute ssh` etc. See https://zed.dev/docs/remote-development for alternatives. - remoting alpha: Added support for terminal and tasks to new experimental ssh remoting
This commit is contained in:
parent
26d0a33e79
commit
583b6235fb
10 changed files with 404 additions and 454 deletions
|
@ -1,3 +1,4 @@
|
|||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -18,6 +19,8 @@ use gpui::{
|
|||
};
|
||||
use markdown::Markdown;
|
||||
use markdown::MarkdownStyle;
|
||||
use project::terminals::wrap_for_ssh;
|
||||
use project::terminals::SshCommand;
|
||||
use rpc::proto::RegenerateDevServerTokenResponse;
|
||||
use rpc::{
|
||||
proto::{CreateDevServerResponse, DevServerStatus},
|
||||
|
@ -28,7 +31,6 @@ use settings::Settings;
|
|||
use task::HideStrategy;
|
||||
use task::RevealStrategy;
|
||||
use task::SpawnInTerminal;
|
||||
use task::TerminalWorkDir;
|
||||
use terminal_view::terminal_panel::TerminalPanel;
|
||||
use ui::ElevationIndex;
|
||||
use ui::Section;
|
||||
|
@ -1638,6 +1640,13 @@ pub async fn spawn_ssh_task(
|
|||
];
|
||||
|
||||
let ssh_connection_string = ssh_connection_string.to_string();
|
||||
let (command, args) = wrap_for_ssh(
|
||||
&SshCommand::DevServer(ssh_connection_string.clone()),
|
||||
Some((&command, &args)),
|
||||
None,
|
||||
HashMap::default(),
|
||||
None,
|
||||
);
|
||||
|
||||
let terminal = terminal_panel
|
||||
.update(cx, |terminal_panel, cx| {
|
||||
|
@ -1649,10 +1658,7 @@ pub async fn spawn_ssh_task(
|
|||
command,
|
||||
args,
|
||||
command_label: ssh_connection_string.clone(),
|
||||
cwd: Some(TerminalWorkDir::Ssh {
|
||||
ssh_command: ssh_connection_string,
|
||||
path: None,
|
||||
}),
|
||||
cwd: None,
|
||||
use_new_terminal: true,
|
||||
allow_concurrent_runs: false,
|
||||
reveal: RevealStrategy::Always,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue