Ticket #114 (new defect)

Opened 21 months ago

Last modified 21 months ago

does not play well with minTTY on windows

Reported by: malcolmw Owned by:
Priority: minor Milestone:
Version: Keywords:
Cc:

Description

Haskeline, at least when baked into a Windows-native build of ghc, appears not to work well with the minTTY terminal emulator. Neither the arrow keys, nor vi key bindings do anything useful - they simply corrupt the buffer being passed to the underlying program by adding odd non-printable characters.

I think the cause is similar to the reason that Windows-native Python does not work interactively in minTTY without special options. To quote http://code.google.com/p/mintty/issues/detail?id=56

"This is due to MinTTY being based on Cygwin pty's, which do not play well with Windows console apps. [...] basically it's because the pty emulation is based on pipes, which means that a Win32 application running in MinTTY sees a pipe rather than a console as its input, so it behaves differently."

For instance, the _isatty() call will return False when run inside minTTY. The webpage goes into some more details, but I think the main problem is that Windows-native (rather than Cygwin) programs have no API available to them to manipulate a "pseudo terminal".

I'm not certain the issue is fixable in Haskeline, but thought it worth noting, even if only for googleability.

Change History

Changed 21 months ago by judah

Thanks for the report; see also ticket #1. Originally I planned to support Cygwin terminals by way of versions of GHC that were built against the Cygwin runtime. Unfortunately, that possibility hasn't been supported for a while now.

I'll try looking into whether there's a more lightweight alternative.

Note: See TracTickets for help on using tickets.