From 5a1f46846bd67a54218cadbf419906721846a8c7 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 26 May 2022 14:08:29 +0200 Subject: [PATCH] Support options in $PAGER and inherit both streams --- .../java/org/truffleruby/launcher/RubyLauncher.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/launcher/java/org/truffleruby/launcher/RubyLauncher.java b/src/launcher/java/org/truffleruby/launcher/RubyLauncher.java index 8f44a0bbe067..4a38ee7a51b2 100644 --- a/src/launcher/java/org/truffleruby/launcher/RubyLauncher.java +++ b/src/launcher/java/org/truffleruby/launcher/RubyLauncher.java @@ -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());