From: Gisle Vanem <gisle.vanem@gmail.com>
To: bug-gnulib@gnu.org
Subject: Re: isatty: make it return true in Cygwin consoles on native Windows
Date: Fri, 15 Mar 2019 10:24:05 +0100 [thread overview]
Message-ID: <2c042666-bf3f-1096-29f6-991495613e46@gmail.com> (raw)
In-Reply-To: <2401179.5IOFXfDAMd@omega>
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
next prev parent reply other threads:[~2019-03-15 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 22:59 isatty: make it return true in Cygwin consoles on native Windows Bruno Haible
2019-03-15 9:24 ` Gisle Vanem [this message]
2019-03-15 11:32 ` Bruno Haible
2019-03-15 18:49 ` Gisle Vanem
2019-03-15 19:42 ` Bruno Haible
2019-03-15 20:16 ` LRN
2019-03-15 22:24 ` Bruno Haible
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c042666-bf3f-1096-29f6-991495613e46@gmail.com \
--to=gisle.vanem@gmail.com \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).