mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 18:36:18 +04:00
Merge 6336ab43b3
into dc941d6d24
This commit is contained in:
commit
c5469a4964
@ -380,6 +380,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)]
|
||||
@ -413,6 +415,7 @@ pub fn get_terminal_provider() -> Option<TerminalConfig> {
|
||||
return Some(TerminalConfig {
|
||||
command: "tmux".to_string(),
|
||||
args: vec!["split-window".to_string()],
|
||||
join_args: false,
|
||||
});
|
||||
}
|
||||
|
||||
@ -420,6 +423,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,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ fn execution_pause_indicator<'doc>(
|
||||
) -> GutterFn<'doc> {
|
||||
let style = theme.get("ui.debug.active");
|
||||
let current_stack_frame = editor.current_stack_frame();
|
||||
let frame_line = current_stack_frame.map(|frame| frame.line - 1);
|
||||
let frame_line = current_stack_frame.and_then(|frame| frame.line.checked_sub(1));
|
||||
let frame_source_path = current_stack_frame.map(|frame| {
|
||||
frame
|
||||
.source
|
||||
|
@ -366,12 +366,33 @@ pub async fn handle_debugger_message(&mut self, payload: helix_dap::Payload) ->
|
||||
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()
|
||||
{
|
||||
process
|
||||
.args(
|
||||
config
|
||||
.args
|
||||
.into_iter()
|
||||
.map(|s| s.replace("%{cwd}", &arguments.cwd)), // temporary until #11164 is merged
|
||||
)
|
||||
.current_dir(arguments.cwd);
|
||||
|
||||
if config.join_args {
|
||||
process.arg(arguments.args.join(" "));
|
||||
} else {
|
||||
process.args(arguments.args);
|
||||
}
|
||||
|
||||
if let Some(env) = arguments.env {
|
||||
for (k, v) in env {
|
||||
match v {
|
||||
Some(v) => process.env(k, v),
|
||||
None => process.env_remove(k),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
let process = match process.spawn() {
|
||||
Ok(process) => process,
|
||||
Err(err) => {
|
||||
self.set_error(format!("Error starting external terminal: {}", err));
|
||||
|
Loading…
Reference in New Issue
Block a user