@@ -2060,18 +2060,14 @@ fn run_shell_command(
2060 return Ok(());
2060 return Ok(());
2063− let shell = &cx.editor.config().shell;
2063+ let shell = cx.editor.config().shell.clone();
2064− let (output, success) = shell_impl(shell, &args.join(" "), None)?;
2064+ let args = args.join(" ");
2066− cx.editor.set_status("Command succeeded");
2068− cx.editor.set_error("Command failed");
2071− if !output.is_empty() {
2072− let callback = async move {
2066+ let callback = async move {
2067+ let (output, success) = shell_impl_async(&shell, &args, None).await?;
2073− let call: job::Callback = Callback::EditorCompositor(Box::new(
2068+ let call: job::Callback = Callback::EditorCompositor(Box::new(
2074− move |editor: &mut Editor, compositor: &mut Compositor| {
2069+ move |editor: &mut Editor, compositor: &mut Compositor| {
2070+ if !output.is_empty() {
2075 let contents = ui::Markdown::new(
2071 let contents = ui::Markdown::new(
2076 format!("```sh\n{}\n```", output),
2072 format!("```sh\n{}\n```", output),
2077 editor.syn_loader.clone(),
2073 editor.syn_loader.clone(),
@@ -2080,13 +2076,17 @@ fn run_shell_command(
2080 helix_core::Position::new(editor.cursor().0.unwrap_or_default().row, 2),
2076 helix_core::Position::new(editor.cursor().0.unwrap_or_default().row, 2),
2082 compositor.replace_or_push("shell", popup);
2078 compositor.replace_or_push("shell", popup);
2081+ editor.set_status("Command succeeded");
2083+ editor.set_error("Command failed");
2085− Ok(call)
2087+ Ok(call)
2088− cx.jobs.callback(callback);
2089+ cx.jobs.callback(callback);