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