haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
221 stars 75 forks source link

Properly disable echoing in getPassword when running in MinTTY #52

Closed RyanGlScott closed 7 years ago

RyanGlScott commented 7 years ago

This copies over functionality from the echo library that, on Windows, detects if we're running in a MinTTY console, and if so, shells out to stty to disable/enable input echoing instead of hSetEcho/hGetEcho, which are broken on MinTTY.

Fixes #50.

RyanGlScott commented 7 years ago

Thanks for your feedback, @judah. I've shuffled the code around so that withoutInputEcho is now a field of FileOps. I've also made minTTY take a Handle as an argument.