git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	git@vger.kernel.org, Pranit Bauva <pranit.bauva@gmail.com>
Subject: Re: [PATCH 1/1] mingw: intercept isatty() to handle /dev/null as Git expects it
Date: Fri, 16 Dec 2016 10:08:53 -0800	[thread overview]
Message-ID: <xmqqy3zfsq4q.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <129f000c-49c1-0e75-26b3-c96e9b442443@kdbg.org> (Johannes Sixt's message of "Fri, 16 Dec 2016 18:48:01 +0100")

Johannes Sixt <j6t@kdbg.org> writes:

> Am 11.12.2016 um 12:16 schrieb Johannes Schindelin:
>> When Git's source code calls isatty(), it really asks whether the
>> respective file descriptor is connected to an interactive terminal.
>> ...
>> +			if (!GetConsoleScreenBufferInfo(handle, &dummy))
>> +				res = 0;
>
> I am sorry to have to report that this check does not work as
> expected. I am operating Git from CMD, not mintty, BTW.

Ouch.

Sorry for not having waited for you to chime in before agreeing to
fast-track this one, and now this is in 'master'.

I should have known better than that by now, after having seen you
uncover bugs that did not trigger in Dscho's environment and vice
versa to tell you that Windows specific things both of you deem good
have a much higher chance of being correct than a change without an
Ack by the other.



> It fails with GetLastError() == 6 (invalid handle value). The reason
> for this is, I think, that in reality we are not writing to the
> console directly, but to a pipe, which is drained by console_thread(),
> which writes to the console.
>
> I have little clue what this winansi.c file is doing. Do you have any
> pointers where I should start digging?
>
> Wait...
>
> Should we not use winansi_get_osfhandle() instead of _get_osfhandle()?
>
>> +		}
>> +	}
>> +
>> +	return res;
>> +}
>> +
>>  void winansi_init(void)
>>  {
>>  	int con1, con2;
>>

  reply	other threads:[~2016-12-16 18:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 11:16 [PATCH 0/1] Fix a long-standing isatty() problem on Windows Johannes Schindelin
2016-12-11 11:16 ` [PATCH 1/1] mingw: intercept isatty() to handle /dev/null as Git expects it Johannes Schindelin
2016-12-16 17:48   ` Johannes Sixt
2016-12-16 18:08     ` Junio C Hamano [this message]
2016-12-16 18:44       ` Johannes Sixt
2016-12-16 19:05         ` Junio C Hamano
2016-12-21 17:56           ` Johannes Schindelin
2016-12-18 15:26         ` [PATCH] winansi_isatty(): fix when Git is used from CMD Johannes Sixt
2016-12-18 15:37           ` Johannes Sixt
2016-12-19 19:34             ` Johannes Sixt
2016-12-21 17:57               ` Johannes Schindelin
2016-12-20 16:53             ` Johannes Schindelin
2016-12-19  1:12           ` Junio C Hamano
2016-12-20 16:50           ` Johannes Schindelin
2016-12-20 16:59             ` Junio C Hamano
2016-12-21 17:59               ` Johannes Schindelin
2016-12-21 18:54                 ` Junio C Hamano
2016-12-22  9:23                   ` Johannes Schindelin
2016-12-11 17:49 ` [PATCH 0/1] Fix a long-standing isatty() problem on Windows Junio C Hamano
2016-12-12  9:59   ` Johannes Schindelin
2016-12-12 16:46     ` Junio C Hamano

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: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy3zfsq4q.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=pranit.bauva@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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