Skip to content

Commit

Permalink
AIX issue with non english locales (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet authored Oct 24, 2023
1 parent 2c8891a commit 77283f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions terminal/src/main/java/org/jline/utils/ExecHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.Objects;

/**
Expand All @@ -28,6 +29,12 @@ public static String exec(boolean redirectInput, final String... cmd) throws IOE
try {
Log.trace("Running: ", cmd);
ProcessBuilder pb = new ProcessBuilder(cmd);
if (OSUtils.IS_AIX) {
Map<String, String> env = pb.environment();
env.put("PATH", "/opt/freeware/bin:" + env.get("PATH"));
env.put("LANG", "C");
env.put("LC_ALL", "C");
}
if (redirectInput) {
pb.redirectInput(ProcessBuilder.Redirect.INHERIT);
}
Expand Down
2 changes: 2 additions & 0 deletions terminal/src/main/java/org/jline/utils/OSUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class OSUtils {
public static final boolean IS_OSX =
System.getProperty("os.name").toLowerCase().contains("mac");

public static final boolean IS_AIX = System.getProperty("os.name").equals("AIX");

public static String TTY_COMMAND;
public static String STTY_COMMAND;
public static String STTY_F_OPTION;
Expand Down

0 comments on commit 77283f8

Please sign in to comment.