Skip to content

Commit

Permalink
Windows gitbash: JLine will create dumb terminal if JNA lib is in cla…
Browse files Browse the repository at this point in the history
…sspath, fixes #599
  • Loading branch information
mattirn committed Nov 7, 2020
1 parent 1c9f16d commit fe1f271
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,9 @@ private Terminal doBuild() throws IOException {
Terminal terminal = null;
if (OSUtils.IS_WINDOWS) {
boolean ansiPassThrough = OSUtils.IS_CONEMU;
boolean winConsole = true;
if (terminal == null && jna) {
try {
JnaSupport support = load(JnaSupport.class);
winConsole = support.isWindowsConsole();
terminal = support.winSysTerminal(name, type, ansiPassThrough, encoding, codepage, nativeSignals, signalHandler, paused);
} catch (Throwable t) {
Log.debug("Error creating JNA based terminal: ", t.getMessage(), t);
Expand All @@ -340,7 +338,6 @@ private Terminal doBuild() throws IOException {
if (terminal == null && jansi) {
try {
JansiSupport support = load(JansiSupport.class);
winConsole = support.isWindowsConsole();
terminal = support.winSysTerminal(name, type, ansiPassThrough, encoding, codepage, nativeSignals, signalHandler, paused);
} catch (Throwable t) {
Log.debug("Error creating JANSI based terminal: ", t.getMessage(), t);
Expand All @@ -350,7 +347,7 @@ private Terminal doBuild() throws IOException {
//
// Cygwin support
//
if (terminal == null && exec && (OSUtils.IS_CYGWIN || OSUtils.IS_MSYSTEM) && winConsole) {
if (terminal == null && exec && (OSUtils.IS_CYGWIN || OSUtils.IS_MSYSTEM)) {
try {
Pty pty = ExecPty.current();
// Cygwin defaults to XTERM, but actually supports 256 colors,
Expand Down

0 comments on commit fe1f271

Please sign in to comment.