Class OSUtils
- java.lang.Object
-
- org.jline.utils.OSUtils
-
public class OSUtils extends java.lang.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 Summary
Fields Modifier and Type Field Description static java.lang.String
INFOCMP_COMMAND
static boolean
IS_AIX
static boolean
IS_CONEMU
static boolean
IS_CYGWIN
static boolean
IS_LINUX
static boolean
IS_MINGW
Deprecated.static boolean
IS_MSYSTEM
static boolean
IS_OSX
static boolean
IS_WINDOWS
static boolean
IS_WSL
static boolean
IS_WSL1
static boolean
IS_WSL2
static java.lang.String
STTY_COMMAND
static java.lang.String
STTY_F_OPTION
static java.lang.String
TEST_COMMAND
static java.lang.String
TTY_COMMAND
-
Constructor Summary
Constructors Constructor Description OSUtils()
-
-
-
Field Detail
-
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 java.lang.String TTY_COMMAND
-
STTY_COMMAND
public static java.lang.String STTY_COMMAND
-
STTY_F_OPTION
public static java.lang.String STTY_F_OPTION
-
INFOCMP_COMMAND
public static java.lang.String INFOCMP_COMMAND
-
TEST_COMMAND
public static java.lang.String TEST_COMMAND
-
-