Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/agent_servers/src/acp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ impl AcpConnection {
project.remote_client().and_then(|client| {
let template = client
.read(cx)
.build_command_with_options(
.build_command(
Some(command.path.display().to_string()),
&command.args,
&command.env.clone().into_iter().flatten().collect(),
Expand Down
3 changes: 2 additions & 1 deletion crates/project/src/context_server_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use http_client::HttpClient;
use itertools::Itertools;
use rand::Rng as _;
use registry::ContextServerDescriptorRegistry;
use remote::RemoteClient;
use remote::{Interactive, RemoteClient};
use rpc::{AnyProtoClient, TypedEnvelope, proto};
use settings::{Settings as _, SettingsStore};
use util::{ResultExt as _, rel_path::RelPath};
Expand Down Expand Up @@ -801,6 +801,7 @@ impl ContextServerStore {
&response.env.into_iter().collect(),
root_dir,
None,
Interactive::Yes,
)
})?;

Expand Down
2 changes: 1 addition & 1 deletion crates/project/src/debugger/dap_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl DapStore {
}

let command = remote.read_with(cx, |remote, _cx| {
remote.build_command_with_options(
remote.build_command(
binary.command,
&binary.arguments,
&binary.envs,
Expand Down
4 changes: 3 additions & 1 deletion crates/project/src/terminals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use async_channel::bounded;
use futures::{FutureExt, future::Shared};
use itertools::Itertools as _;
use language::LanguageName;
use remote::RemoteClient;
use remote::{Interactive, RemoteClient};
use settings::{Settings, SettingsLocation};
use std::{
borrow::Cow,
Expand Down Expand Up @@ -558,6 +558,7 @@ impl Project {
&env,
None,
None,
Interactive::Yes,
)?;
let mut command = new_std_command(command_template.program);
command.args(command_template.args);
Expand Down Expand Up @@ -631,6 +632,7 @@ fn create_remote_shell(
&env,
working_directory.map(|path| path.display().to_string()),
None,
Interactive::Yes,
)?;

log::debug!("Connecting to a remote server: {:?}", command.program);
Expand Down
18 changes: 0 additions & 18 deletions crates/remote/src/remote_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -930,24 +930,6 @@ impl RemoteClient {
env: &HashMap<String, String>,
working_dir: Option<String>,
port_forward: Option<(u16, String, u16)>,
) -> Result<CommandTemplate> {
self.build_command_with_options(
program,
args,
env,
working_dir,
port_forward,
Interactive::Yes,
)
}

pub fn build_command_with_options(
&self,
program: Option<String>,
args: &[String],
env: &HashMap<String, String>,
working_dir: Option<String>,
port_forward: Option<(u16, String, u16)>,
interactive: Interactive,
) -> Result<CommandTemplate> {
let Some(connection) = self.remote_connection() else {
Expand Down
18 changes: 10 additions & 8 deletions crates/remote/src/transport/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1863,9 +1863,9 @@ fn build_command_posix(
));
}

// -q suppresses the "Connection to ... closed." message that SSH prints when
// the connection terminates with -t (pseudo-terminal allocation)
args.push("-q".into());
// LogLevel=ERROR suppresses the "Connection to ... closed." message while
// preserving SSH errors.
args.extend(["-o".into(), "LogLevel=ERROR".into()]);
match interactive {
// -t forces pseudo-TTY allocation (for interactive use)
Interactive::Yes => args.push("-t".into()),
Expand Down Expand Up @@ -1958,9 +1958,9 @@ fn build_command_windows(
));
}

// -q suppresses the "Connection to ... closed." message that SSH prints when
// the connection terminates with -t (pseudo-terminal allocation)
args.push("-q".into());
// LogLevel=ERROR suppresses the "Connection to ... closed." message while
// preserving SSH errors.
args.extend(["-o".into(), "LogLevel=ERROR".into()]);
match interactive {
// -t forces pseudo-TTY allocation (for interactive use)
Interactive::Yes => args.push("-t".into()),
Expand Down Expand Up @@ -2039,7 +2039,8 @@ mod tests {
[
"-p",
"2222",
"-q",
"-o",
"LogLevel=ERROR",
"-t",
"user@host",
"cd \"$HOME\"/work && exec env 'INPUT_VA=val' remote_program arg1 arg2"
Expand Down Expand Up @@ -2075,7 +2076,8 @@ mod tests {
"2222",
"-L",
"1:foo:2",
"-q",
"-o",
"LogLevel=ERROR",
"-t",
"user@host",
"cd && exec env 'INPUT_VA=val' /bin/fish -l"
Expand Down
Loading