optionaly join args

pull/11492/head
Vulpesx 4 months ago
parent ff33b07756
commit 76c8a74cb4
No known key found for this signature in database
GPG Key ID: 16151F7622E4957D

@ -370,6 +370,8 @@ pub struct TerminalConfig {
#[serde(default)]
#[serde(skip_serializing_if = "Vec::is_empty")]
pub args: Vec<String>,
#[serde(default)]
pub join_args: bool,
}
#[cfg(windows)]
@ -403,6 +405,7 @@ pub fn get_terminal_provider() -> Option<TerminalConfig> {
return Some(TerminalConfig {
command: "tmux".to_string(),
args: vec!["split-window".to_string()],
join_args: false,
});
}
@ -410,6 +413,7 @@ pub fn get_terminal_provider() -> Option<TerminalConfig> {
return Some(TerminalConfig {
command: "wezterm".to_string(),
args: vec!["cli".to_string(), "split-pane".to_string()],
join_args: false,
});
}

@ -366,12 +366,16 @@ impl Editor {
Some(debugger) => debugger,
None => return false,
};
let mut process = std::process::Command::new(config.command);
let process = match std::process::Command::new(config.command)
.args(config.args)
.arg(arguments.args.join(" "))
.spawn()
{
if config.join_args {
process.arg(arguments.args.join(" "));
} else {
process.args(arguments.args);
}
let process = match process.spawn() {
Ok(process) => process,
Err(err) => {
self.set_error(format!("Error starting external terminal: {}", err));

Loading…
Cancel
Save