@hackage / mintty

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

Latest0.1.4

About

Metadata

  • Last updated , by ryanglscott
  • License BSD-3-Clause
  • Categories Systems Programming
  • Maintained by: Ryan Scott <ryan.gl.scott@gmail.com>

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.2.2
  2. 9.0.2
  3. 8.10.7
  4. 8.8.4
  5. 8.6.5
  6. 8.4.4
  7. 8.2.2
  8. 8.0.2
  9. 7.10.3

Package Flags

Use the -f option with cabal commands to enable 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.

Readme

mintty

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.