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

LTS Haskell 21.12:0.1.4
Stackage Nightly 2023-09-21:0.1.4
Latest on Hackage:0.1.4

See all snapshots mintty appears in

BSD-3-Clause licensed by Ryan Scott
Maintained by Ryan Scott
This version can be pinned in stack with:mintty-0.1.4@sha256:045829806c38221f8e61bba674131147e6ef969882e33b6ce34c39a66e8179be,3334

Module documentation for 0.1.4

Depends on 1 package(full list with versions):
Used by 1 package in nightly-2023-05-28(full list with versions):


Hackage Hackage Dependencies Haskell Programming Language BSD3 License Linux build Windows build

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.4 [2022.06.30]

  • Remove an unused dependency on filepath.

0.1.3 [2021.11.07]

  • Backport a fix for a Win32 bug that would make isMinTTY incorrectly return False on recent versions of MinTTY.

0.1.2 [2018.05.07]

  • Only use the Win32-provided version of isMinTTY if building against Win32-2.5.3 to be certain that one avoids Trac #13431.
  • Don’t enable Safe on GHC 7.2.

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