Johannes Sixt <j6t@xxxxxxxx> 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; >>