max630 / git-rehi

git-rehi, history editor
https://github.com/max630/git-rehi/wiki
GNU General Public License v2.0
3 stars 0 forks source link

Windows: correctly detect mintty as console #54

Closed max630 closed 7 years ago

max630 commented 7 years ago

When started from mintty, isatty/mingw32 does not detect working from terminal and sets buffered output. Fix it by performing additional check, similarly as the way used here: https://github.com/git/git/commit/f7f90e0f4f

References to use: https://msdn.microsoft.com/en-us/library/bb432383.aspx - NtQueryObject function https://msdn.microsoft.com/en-us/library/windows/desktop/aa380518.aspx - UNICODE_STRING structure https://github.com/haskell/win32/blob/master/System/Win32/File.hsc - example how to use Win32 from Haskell (no that function)