Skip to content

Commit 5a1f468

Browse files
committed
Support options in $PAGER and inherit both streams
1 parent b9e9375 commit 5a1f468

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/launcher/java/org/truffleruby/launcher/RubyLauncher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ protected boolean runLauncherAction() {
191191
String pager;
192192
if (helpOptionUsed && System.console() != null && !(pager = getPagerFromEnv()).isEmpty()) {
193193
try {
194-
Process process = new ProcessBuilder(pager)
195-
.redirectOutput(Redirect.INHERIT)
196-
.redirectErrorStream(true)
194+
Process process = new ProcessBuilder(pager.split(" "))
195+
.redirectOutput(Redirect.INHERIT) // set the output of the pager to the terminal and not a pipe
196+
.redirectError(Redirect.INHERIT) // set the error of the pager to the terminal and not a pipe
197197
.start();
198198
PrintStream out = new PrintStream(process.getOutputStream());
199199

0 commit comments

Comments
 (0)