Module for platform-specific constants and implementations, as well as compatibility layers to make use of the ‘best’ implementation available on a platform.


Determines the command for Bash on the current platform.


Returns the path to git for windows, if available and None otherwise.


Returns a tuple contains two strings: the hash and the date.


Tests if the prompt_toolkit is available.


Checks if readline is available to import.


The id of the Linux distribution running on, possibly ‘unknown’. None on non-Linux platforms.


This is a safe version of os.path.basename(), which does not work on input without a drive. This version does.


This is a safe version of os.path.split(), which does not work on input without a drive.


Returns prompt_toolkit.__version__ if available, else None.


Returns prompt_toolkit’s version as tuple of integers.


pygments.__version__ version if available, else None.


Returns pygments’s version as tuple of integers.


Determines the command for Bash on windows.


A Windows-specific expanduser() function for xonsh. This is needed since os.path.expanduser() does not check on Windows if the user actually exists. This restricts expanding the ‘~’ if it is not followed by a separator. That is only ‘~/’ and ‘~’ are expanded.

xonsh.platform.CAN_RESIZE_WINDOW = <xonsh.lazyasd.LazyBool object>

True if we can resize terminal window, as provided by the presense of signal.SIGWINCH, else False.

xonsh.platform.DEFAULT_ENCODING = 'utf-8'

Default string encoding.

xonsh.platform.IN_APPIMAGE = False

True if in AppImage, else False.

xonsh.platform.ON_ANACONDA = <xonsh.lazyasd.LazyBool object>

True if executed in an Anaconda instance, else False.

xonsh.platform.ON_CYGWIN = False

True if executed on a Cygwin Windows platform, else False.

xonsh.platform.ON_DARWIN = False

True if executed on a Darwin platform, else False.

xonsh.platform.ON_DRAGONFLY = False

True if on a DragonFly BSD operating system, else False.

xonsh.platform.ON_FREEBSD = False

True if on a FreeBSD operating system, else False.

xonsh.platform.ON_LINUX = True

True if executed on a Linux platform, else False.

xonsh.platform.ON_MSYS = False

True if executed on a MSYS Windows platform, else False.

xonsh.platform.ON_NETBSD = False

True if on a NetBSD operating system, else False.

xonsh.platform.ON_OPENBSD = False

True if on a OpenBSD operating system, else False.

xonsh.platform.ON_POSIX = True

True if executed on a POSIX-compliant platform, else False.

xonsh.platform.ON_WINDOWS = False

True if executed on a native Windows platform, else False.

xonsh.platform.PYTHON_VERSION_INFO = (3, 11, 8)

Version of Python interpreter as three-value tuple.

xonsh.platform.minimum_required_ptk_version = (2, 0, 0)

Minimum version of prompt-toolkit supported by Xonsh