Skip to content

Commit

Permalink
Support for MSYS2 subsystem/shell, fixes #241
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 26, 2018
1 parent adb1d94 commit 5b2578c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private Terminal doBuild() throws IOException {
//
// Cygwin support
//
if ((OSUtils.IS_CYGWIN || OSUtils.IS_MINGW) && exec && !cygwinTerm) {
if ((OSUtils.IS_CYGWIN || OSUtils.IS_MSYSTEM) && exec && !cygwinTerm) {
try {
Pty pty = ExecPty.current();
// Cygwin defaults to XTERM, but actually supports 256 colors,
Expand Down
8 changes: 7 additions & 1 deletion terminal/src/main/java/org/jline/utils/OSUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ public class OSUtils {
&& System.getenv("PWD") != null
&& System.getenv("PWD").startsWith("/");

@Deprecated
public static final boolean IS_MINGW = IS_WINDOWS
&& System.getenv("MSYSTEM") != null
&& System.getenv("MSYSTEM").startsWith("MINGW");

public static final boolean IS_MSYSTEM = IS_WINDOWS
&& System.getenv("MSYSTEM") != null
&& (System.getenv("MSYSTEM").startsWith("MINGW")
|| System.getenv("MSYSTEM").equals("MSYSTEM"));

This comment has been minimized.

Copy link
@robby-phd

robby-phd Mar 26, 2018

This should be || System.getenv("MSYSTEM").equals("MSYS").

This comment has been minimized.

Copy link
@gnodet

gnodet Mar 26, 2018

Author Member

Nice catch, let me fix that asap. Thx !


public static final boolean IS_CONEMU = IS_WINDOWS
&& System.getenv("ConEmuPID") != null;

Expand All @@ -37,7 +43,7 @@ public class OSUtils {
String stty;
String sttyfopt;
String infocmp;
if (OSUtils.IS_CYGWIN || OSUtils.IS_MINGW) {
if (OSUtils.IS_CYGWIN || OSUtils.IS_MSYSTEM) {
tty = "tty.exe";
stty = "stty.exe";
sttyfopt = null;
Expand Down

0 comments on commit 5b2578c

Please sign in to comment.