From db75e1975132298cde053eb244c36a1160966dce Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sun, 12 May 2024 09:38:22 +0900 Subject: [PATCH] cli: insert tracing at editor/pager invocation This should help debug Windows mess. --- cli/src/cli_util.rs | 5 ++++- cli/src/ui.rs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 059af819d..f2849a851 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -2170,7 +2170,10 @@ pub fn run_ui_editor(settings: &UserSettings, edit_path: &PathBuf) -> Result<(), .config() .get("ui.editor") .map_err(|err| config_error_with_message("Invalid `ui.editor`", err))?; - let exit_status = editor.to_command().arg(edit_path).status().map_err(|err| { + let mut cmd = editor.to_command(); + cmd.arg(edit_path); + tracing::info!(?cmd, "running editor"); + let exit_status = cmd.status().map_err(|err| { user_error_with_message( format!( // The executable couldn't be found or run; command-line arguments are not relevant diff --git a/cli/src/ui.rs b/cli/src/ui.rs index 27db4d800..2f21ed0e1 100644 --- a/cli/src/ui.rs +++ b/cli/src/ui.rs @@ -105,7 +105,9 @@ impl UiOutput { } fn new_paged(pager_cmd: &CommandNameAndArgs) -> io::Result { - let mut child = pager_cmd.to_command().stdin(Stdio::piped()).spawn()?; + let mut cmd = pager_cmd.to_command(); + tracing::info!(?cmd, "spawning pager"); + let mut child = cmd.stdin(Stdio::piped()).spawn()?; let child_stdin = child.stdin.take().unwrap(); Ok(UiOutput::Paged { child, child_stdin }) }