Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIX issue with non english locales #881

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading