bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isatty: make it return true in Cygwin consoles on native Windows


From: Gisle Vanem
Subject: Re: isatty: make it return true in Cygwin consoles on native Windows
Date: Fri, 15 Mar 2019 10:24:05 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3

Bruno Haible wrote:

+          if (QueryFullProcessImageNameFunc (processHandle, 0, buf, &bufsize))
+            {
+              if (strlen (buf) >= 11
+                  && strcmp (buf + strlen (buf) - 11, "\\mintty.exe") == 0)

What if the .exe has another name?

The purpose of your function looks similar to what Mihail Konev
did for the MinGW-w64 project:
  
https://mingw-w64-public.narkive.com/s7kYRrtG/patch-mingw-w64-add-include-iscygtty-c

Instead he looked for pipes matching:
"\Device\NamedPipe\(cygwin|msys)-[a-fA-F0-9]{16}-pty[0-9]{1,4}-(from-master|to-master|to-master-cyg)"

BTW.
I created my own version of in his work in my Envtool
program. The 'is_cygwin_tty()' function:
  https://github.com/gvanem/EnvTool/blob/master/src/misc.c#L3918


--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]