Skip to content

Commit

Permalink
cli: set LESS=FRX when running $PAGER
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevault committed Nov 11, 2024
1 parent 6739dcc commit 5fb3e2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ impl UiOutput {
fn new_paged(pager_cmd: &CommandNameAndArgs) -> io::Result<UiOutput> {
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 })
}
Expand Down

0 comments on commit 5fb3e2b

Please sign in to comment.