Class OSUtils

java.lang.Object
org.aesh.terminal.utils.OSUtils

public final class OSUtils extends Object
Operating system detection and command utilities.
  • Field Details

    • IS_LINUX

      public static final boolean IS_LINUX
      True if running on Linux.
    • IS_WINDOWS

      public static final boolean IS_WINDOWS
      True if running on Windows.
    • IS_CYGWIN

      public static final boolean IS_CYGWIN
      True if running in a Cygwin, MSYS2, or Git-Bash POSIX environment on Windows.

      Detection uses multiple indicators because no single env var is reliable across all launch contexts (IDE, cmd.exe, PowerShell, mintty):

      • MSYSTEM — set by MSYS2 and Git-Bash (e.g., MINGW64, UCRT64)
      • CYGWIN — set in Cygwin environments
      • TERM_PROGRAM=mintty — the default Cygwin/MSYS2 terminal
      • PWD starting with / — legacy heuristic, still valid in many setups
    • IS_OSX

      public static final boolean IS_OSX
      True if running on macOS.
    • IS_HPUX

      public static final boolean IS_HPUX
      True if running on HP-UX.
    • IS_SUNOS

      public static final boolean IS_SUNOS
      True if running on SunOS/Solaris.
    • TTY_COMMAND

      public static final String TTY_COMMAND
      Path to the tty command.
    • STTY_COMMAND

      public static final String STTY_COMMAND
      Path to the stty command.
    • STTY_F_OPTION

      public static final String STTY_F_OPTION
      The -f/-F option for stty based on OS.
    • INFOCMP_COMMAND

      public static final String INFOCMP_COMMAND
      Path to the infocmp command.