code: private static boolean setVTMode() {
          long console = GetStdHandle(STD_OUTPUT_HANDLE);
          int[] mode = new int[1];
          if (Kernel32.GetConsoleMode(console, mode) == 0) {
              // No need to go further, not supported.
              return false;
          }
          if (Kernel32.SetConsoleMode(console, mode[0] | VIRTUAL_TERMINAL_PROCESSING) == 0) {
              // No need to go further, not supported.
              return false;
          }
  
          return true;
      }
docs: This allows to take benefit from Windows 10+ new features.