Skip to content

Commit

Permalink
Add simple tty check
Browse files Browse the repository at this point in the history
  • Loading branch information
Strech committed May 3, 2022
1 parent 169251c commit 2c83410
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/launcher/java/org/truffleruby/launcher/RubyLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ protected boolean runLauncherAction() {
// non-empty value, and the standard input and output are tty, `--help`
// option shows the help message via the pager designated by the value.

// String value = System.getenv(name);
// if (value != null) {
// value = value.strip();
// if (value.length() != 0) {
if (System.console() == null) {
return super.runLauncherAction();
}

String pager = System.getenv("RUBY_PAGER");
if (pager == null) {
Expand All @@ -199,7 +198,6 @@ protected boolean runLauncherAction() {
return super.runLauncherAction();
}


try {
Process process = new ProcessBuilder(pager)
.redirectOutput(Redirect.INHERIT)
Expand Down

0 comments on commit 2c83410

Please sign in to comment.