TelnetConsole support mingw/cygw color mode. #278

This commit is contained in:
hengyunabc 2018-11-09 01:37:42 +08:00
parent 137bece9d0
commit a082c3cdf8

View File

@ -151,6 +151,14 @@ public class TelnetConsole {
}
public static void main(String[] args) throws IOException {
// support mingw/cygw jline color
if (System.getProperty("os.name").startsWith("Windows")) {
if ((System.getenv("MSYSTEM") != null && System.getenv("MSYSTEM").startsWith("MINGW"))
|| "/bin/shell".equals(System.getenv("SHELL"))) {
System.setProperty("jline.terminal", System.getProperty("jline.terminal", "jline.UnixTerminal"));
}
}
TelnetConsole telnetConsole = new TelnetConsole();
CLI cli = CLIConfigurator.define(TelnetConsole.class);