@hackage mintty0.1.4
A reliable way to detect the presence of a MinTTY console on Windows
Categories
License
BSD-3-Clause
Maintainer
Ryan Scott <ryan.gl.scott@gmail.com>
Links
Versions
Installation
Tested Compilers
Dependencies (2)
Dependents (6)
@hackage/idris, @hackage/acme-everything, @hackage/stack, @hackage/echo, @hackage/ansi-terminal, @hackage/ansi-terminal-game
Package Flags
win32-2-13-1
(on by default)
Use Win32-2.13.1.0 or later. Older versions of Win32
either do not have functionality for detecting MinTTY or
have bugs in their MinTTY detection. For these versions
of Win32, we backport a working version of MinTTY
detection.
mintty
MinTTY is a Windows-specific terminal emulator for the widely used Cygwin and MSYS projects, which provide Unix-like environments for Windows. MinTTY consoles behave differently from native Windows consoles (such as cmd.exe or PowerShell) in many ways, and in some cases, these differences make it necessary to treat MinTTY consoles differently in code.
The mintty library provides a simple way to detect if your code in running in a MinTTY console on Windows. It exports isMinTTY, which does the right thing 90% of the time (by checking if standard error is attached to MinTTY), and it also exports isMinTTYHandle for the other 10% of the time (when you want to check is some arbitrary handle is attached to MinTTY). As you might expect, both of these functions will simply return False on any non-Windows operating system.