Re: [PATCH] winansi_isatty(): fix when Git is used from CMD
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 19, 2016, 01:12 UTC
- Message-ID
- <xmqq37hkrabx.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <ffc6a7a0-4ae4-b755-0b09-5bcd7114a2e6@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 13 quoted lines
> .. > The new isatty() override implemented by cbb3f3c9b197 (mingw: intercept > isatty() to handle /dev/null as Git expects it, 2016-12-11) does not > take into account that _get_osfhandle() returns the handle visible by > the C code, which is the pipe. But it actually wants to investigate the > properties of the handle that is actually connected to the outside > world. Fortunately, there is already winansi_get_osfhandle(), which > returns exactly this handle. Use it. > > Signed-off-by: Johannes Sixt <j6t@kdbg.org> > --- > I was able to test the idea earlier than anticipated and it does work > for me.
I'll queue this in 'pu' so that I won't forget, but this time I'll make sure I won't act on it until I see you two agree on the right way forward.
Thanks.