Better handle shell for remote ssh projects (#19297)
Release Notes: - N/A Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
d35b646dbb
commit
3dcc638537
2 changed files with 20 additions and 8 deletions
|
@ -6,6 +6,7 @@ use itertools::Itertools;
|
|||
use settings::{Settings, SettingsLocation};
|
||||
use smol::channel::bounded;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
env::{self},
|
||||
iter,
|
||||
path::{Path, PathBuf},
|
||||
|
@ -341,10 +342,9 @@ pub fn wrap_for_ssh(
|
|||
venv_directory: Option<PathBuf>,
|
||||
) -> (String, Vec<String>) {
|
||||
let to_run = if let Some((command, args)) = command {
|
||||
iter::once(command)
|
||||
.chain(args)
|
||||
.filter_map(|arg| shlex::try_quote(arg).ok())
|
||||
.join(" ")
|
||||
let command = Cow::Borrowed(command.as_str());
|
||||
let args = args.iter().filter_map(|arg| shlex::try_quote(arg).ok());
|
||||
iter::once(command).chain(args).join(" ")
|
||||
} else {
|
||||
"exec ${SHELL:-sh} -l".to_string()
|
||||
};
|
||||
|
@ -390,9 +390,7 @@ pub fn wrap_for_ssh(
|
|||
SshCommand::Direct(ssh_args) => ("ssh".to_string(), ssh_args.clone()),
|
||||
};
|
||||
|
||||
if command.is_none() {
|
||||
args.push("-t".to_string())
|
||||
}
|
||||
args.push("-t".to_string());
|
||||
args.push(shell_invocation);
|
||||
(program, args)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue