diff --git a/cli/src/ui.rs b/cli/src/ui.rs index b57bf4d904..ddf9a3c84d 100644 --- a/cli/src/ui.rs +++ b/cli/src/ui.rs @@ -132,7 +132,11 @@ impl UiOutput { fn new_paged(pager_cmd: &CommandNameAndArgs) -> io::Result { let mut cmd = pager_cmd.to_command(); tracing::info!(?cmd, "spawning pager"); - let mut child = cmd.stdin(Stdio::piped()).spawn()?; + // LESS=FRX causes escape sequences to render correctly when PAGER=less + // It's harmless when using other pagers + let mut child = cmd + .env("LESS", "FRX") + .stdin(Stdio::piped()).spawn()?; let child_stdin = child.stdin.take().unwrap(); Ok(UiOutput::Paged { child, child_stdin }) }