Home

Awesome

ptycheck

A sample to check if a program running on mintty (or some other terminal) on Cygwin/MSYS.

How to compile

You can use VC6 or later to compile this sample.

If you want to execute the sample on WinXP or if you use VC8 (VC2005) or earlier, you need Win32 FileID API Library (404 now). You need to specify the directory of Win32 FileID API Library with FILEIDAPIDIR:

nmake FILEIDAPIDIR=..\FileIDAPI

If you want to execute the sample on Vista or later and if you use VC9 (VC2008) or later, you don't need Win32 FileID API Library. Just run nmake:

nmake

Configurations of iscygpty.c

iscygpty.c has some configurations:

If both USE_FILEEXTD and USE_DYNFILEID are not defined, the program can run only on Vista or later.

ConPTY

Recent versions of Windows support ConPTY and Cygwin/MSYS2 can use it. This allows an application to run as it is in a normal console window. ptycheck doesn't detect when it is run in ConPTY, which is the expected behavior.

To enable or disable ConPTY, you can set the CYGWIN or MSYS environment variable to enable_pcon or disable_pcon before starting mintty. mintty also supports the -P [on|off] or --pcon [on|off] option.

License

The MIT License. (You can also choose the Vim license.)