Re: [PATCH] mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 26, 2016, 13:28 UTC
- Message-ID
- <alpine.DEB.2.20.1605261525400.4449@virtualbox>
- In-Reply-To
- <f1408371e14ff10539990ad710681ef17f29fea1.1461770158.git.johannes.schindelin@gmx.de>
Hi Junio,
On Wed, 27 Apr 2016, Johannes Schindelin wrote:
Show 17 quoted lines
> From: Karsten Blees <blees@dcon.de>
>
> MSYS2 emulates pseudo terminals via named pipes, and isatty() returns 0
> for such file descriptors. Therefore, some interactive functionality
> (such as launching a pager, asking if a failed unlink should be repeated
> etc.) doesn't work when run in a terminal emulator that uses MSYS2's
> ptys (such as mintty).
>
> However, MSYS2 uses special names for its pty pipes ('msys-*-pty*'),
> which allows us to distinguish them from normal piped input / output.
>
> On startup, check if stdin / stdout / stderr are connected to such pipes
> using the NtQueryObject API from NTDll.dll. If the names match, adjust
> the flags in MSVCRT's ioinfo structure accordingly.
>
> Signed-off-by: Karsten Blees <blees@dcon.de>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>For the record, this patch is needed to make the output of `git log` *not* whizz by when running in MinTTY, the default terminal of Git for Windows and MSYS2.
I do not see this patch in 'pu'... Anything I can do to get this into 'master' eventually?
Ciao, Dscho