A reliable way to detect the presence of a MinTTY console on Windows

Version on this page:0.1
LTS Haskell 8.6:0.1.1
Stackage Nightly 2017-03-29:0.1.1
Latest on Hackage:0.1.1
BSD3 licensed by Ryan Scott
Maintained by Ryan Scott

Module documentation for 0.1


Hackage Hackage Dependencies [Haskell Programming Language][] [BSD3 License][tl;dr Legal: BSD3] Build Windows build "mintty package on Hackage" []: "The Haskell Programming Language" [tl;dr Legal: BSD3]: "BSD 3-Clause License (Revised)"

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.


0.1.1 [2017-03-17]

  • Work around a serious bug on 32-bit Windows GHC that causes linker errors when mintty is used together with code that uses certain msvcrt functions, such as atan

0.1 [2017-01-30]

  • Initial release
Depends on:
comments powered byDisqus