assistant_tools: Make terminal tool work on Windows (#30497)
Release Notes: - N/A
This commit is contained in:
parent
e79d1b27b1
commit
93b6fdb8e5
1 changed files with 6 additions and 2 deletions
|
@ -131,8 +131,12 @@ impl Tool for TerminalTool {
|
|||
Err(err) => return Task::ready(Err(err)).into(),
|
||||
};
|
||||
let program = self.determine_shell.clone();
|
||||
let command = format!("({}) </dev/null", input.command);
|
||||
let args = vec!["-c".into(), command.clone()];
|
||||
let command = if cfg!(windows) {
|
||||
format!("$null | & {{{}}}", input.command.replace("\"", "'"))
|
||||
} else {
|
||||
format!("({}) </dev/null", input.command)
|
||||
};
|
||||
let args = vec!["-c".into(), command];
|
||||
let cwd = working_dir.clone();
|
||||
let env = match &working_dir {
|
||||
Some(dir) => project.update(cx, |project, cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue