ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: insert tracing at editor/pager invocation

This should help debug Windows mess.
This commit is contained in:
Yuya Nishihara 2024-05-12 09:38:22 +09:00
parent e3b3b5586f
commit db75e19751
2 changed files with 7 additions and 2 deletions

View file

@ -2170,7 +2170,10 @@ pub fn run_ui_editor(settings: &UserSettings, edit_path: &PathBuf) -> Result<(),
.config() .config()
.get("ui.editor") .get("ui.editor")
.map_err(|err| config_error_with_message("Invalid `ui.editor`", err))?; .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( user_error_with_message(
format!( format!(
// The executable couldn't be found or run; command-line arguments are not relevant // The executable couldn't be found or run; command-line arguments are not relevant

View file

@ -105,7 +105,9 @@ impl UiOutput {
} }
fn new_paged(pager_cmd: &CommandNameAndArgs) -> io::Result<UiOutput> { fn new_paged(pager_cmd: &CommandNameAndArgs) -> io::Result<UiOutput> {
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(); let child_stdin = child.stdin.take().unwrap();
Ok(UiOutput::Paged { child, child_stdin }) Ok(UiOutput::Paged { child, child_stdin })
} }