Giter Club home page Giter Club logo

ptycheck's Introduction

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:

  • USE_FILEEXTD: If this is defined, Win32 FileID API Library is linked. This is mandatory if you want to detect Cygwin pty on WinXP. If you want to use this, _WIN32_WINNT should be 0x0501 or lower, otherwise _WIN32_WINNT should be 0x0600 or higher.
  • USE_DYNFILEID: If this is defined, GetFileInformationByHandleEx is loaded dynamically (more precisely, explicitly). You can run a program even on WinXP or earlier, but Cygwin pty is not detected on the old OSes when USE_FILEEXTD is not defined.
  • ENABLE_STUB_IMPL: If this is defined and USE_FILEEXTD is not defined and when VC2005 or earlier is used, is_cygpty() becomes stub implementation; it always returns 0.

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.)

ptycheck's People

Contributors

k-takata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ptycheck's Issues

Interactive Mode or Not

This is a feature request. Is it possible to determine if the go code is running in interactive mode or not? So that we can decide if we need to use the options / flag or interactive with end user for options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.