Closed RyanGlScott closed 1 year ago
It's likely that wintty switched to using the Windows console PTY directly, so Conpty. Which is likely what caused the change in behavior. But if that's the case then it should be OK, that should interact correctly.
Did you observe anything breaking?
Did you observe anything breaking?
I haven't done a lot of testing, but everything that I've tried works remarkably well: GHCi history works, tab-completion works, command-line echoing is properly disabled when entering passwords, etc.
Yeah i suspect this is OK. Perhaps the function should have been named isEmulTTY
but that ship has sailed. I think it's correct that it's returning false now.
In that case, I think the only thing left to do is to update the documentation. I've attempted to do so in #217.
Thanks, merged. I'll need to fix the docs generation after my deadline next week. I'll get back to fixing the mingw issue then too. Thanks!
The functions in
System.Win32.MinTTY
are no longer able to detect newer versions ofmintty
. I'm not sure which version ofmintty
changed its behavior, but I can confirm this happening formintty
3.6.1.Current Behavior
isMinTTY
will returnFalse
onmintty
3.6.1.Currently,
isMinTTY
expects thatSTD_ERROR_HANDLE
will always haveFILE_TYPE_PIPE
and usesGetFileInformationByHandleEx
to query information about the pipe. On recent versions ofmintty
, however,STD_ERROR_HANDLE
will instead haveFILE_TYPE_CHAR
. If I try to to useGetFileInformationByHandleEx
on this version ofSTD_ERROR_HANDLE
, it will fail withgetFileInformationByHandleEx: invalid argument (Incorrect function.)
.On the other hand, perhaps this isn't as bad as it sounds. One of the reasons why I wanted the ability to detect the presence of
mintty
in the first place is that in the past,mintty
hasn't supported GHCi very well. Namely, you couldn't use tab completion, you couldn't use arrow keys to navigate through your command history, and Ctrl-C would completely bork GHCi. With recent versions ofmintty
, however, that all appears to be working as expected! That is to say:mintty
and GHCi appear to get along just fine nowadays.In light of this, perhaps we should just change the documentation for
System.Win32.MinTTY
to say that it only detects old versions ofmintty
? I'd consider that a satisfactory resolution, but perhaps there are other reasons one might want to detectmintty
. If that is the case, we'd need a different way to detect it than whatSystem.Win32.MinTTY
is currently using.Steps to Reproduce (for bugs)
To reproduce the bug, simply run
isMinTTY
usingmintty 3.6.1
, which is currently the latest version offered by MSYS2 at the time of writing.Your Environment