Class OSUtils

java.lang.Object
org.jline.utils.OSUtils

public class OSUtils extends Object
Utility class for operating system detection and OS-specific operations.

The OSUtils class provides constants and methods for detecting the current operating system and performing OS-specific operations. It helps JLine components adapt their behavior based on the platform they're running on, which is particularly important for terminal handling where different operating systems have different terminal implementations and capabilities.

This class includes constants for detecting common operating systems:

  • Windows - Including detection of Cygwin and MSYS environments
  • Linux
  • macOS (OSX)
  • AIX
  • Other Unix-like systems

It also provides utility methods for working with file paths, environment variables, and other OS-specific features that affect terminal behavior.

This class is used throughout JLine to ensure correct behavior across different platforms, particularly for terminal detection, path handling, and native library loading.

  • Field Details

    • IS_LINUX

      public static final boolean IS_LINUX
    • IS_WINDOWS

      public static final boolean IS_WINDOWS
    • IS_OSX

      public static final boolean IS_OSX
    • IS_AIX

      public static final boolean IS_AIX
    • IS_CYGWIN

      public static final boolean IS_CYGWIN
    • IS_MINGW

      @Deprecated public static final boolean IS_MINGW
      Deprecated.
    • IS_MSYSTEM

      public static final boolean IS_MSYSTEM
    • IS_WSL

      public static final boolean IS_WSL
    • IS_WSL1

      public static final boolean IS_WSL1
    • IS_WSL2

      public static final boolean IS_WSL2
    • IS_CONEMU

      public static final boolean IS_CONEMU
    • TTY_COMMAND

      public static String TTY_COMMAND
    • STTY_COMMAND

      public static String STTY_COMMAND
    • STTY_F_OPTION

      public static String STTY_F_OPTION
    • INFOCMP_COMMAND

      public static String INFOCMP_COMMAND
    • TEST_COMMAND

      public static String TEST_COMMAND
  • Constructor Details

    • OSUtils

      public OSUtils()