Skip to content

Commit

Permalink
Support options in $PAGER and inherit both streams
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed May 26, 2022
1 parent b9e9375 commit 5a1f468
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/launcher/java/org/truffleruby/launcher/RubyLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ protected boolean runLauncherAction() {
String pager;
if (helpOptionUsed && System.console() != null && !(pager = getPagerFromEnv()).isEmpty()) {
try {
Process process = new ProcessBuilder(pager)
.redirectOutput(Redirect.INHERIT)
.redirectErrorStream(true)
Process process = new ProcessBuilder(pager.split(" "))
.redirectOutput(Redirect.INHERIT) // set the output of the pager to the terminal and not a pipe
.redirectError(Redirect.INHERIT) // set the error of the pager to the terminal and not a pipe
.start();
PrintStream out = new PrintStream(process.getOutputStream());

Expand Down

0 comments on commit 5a1f468

Please sign in to comment.