Terminal does not reset correctly with System.Console.SimpleLineEditor

Hello It appears that the console is not reset correctly with System.Console.SimpleLineEditor. The terminal does not echo characters until it is reset. The following program demonstrates it: import System.Console.SimpleLineEditor main = initialise >> getLineEdited "prompt> " >>= print >> restore This occurs with the Debian ghc package version 6.2.1 and the binary cvs snapshot of 20041017, both on i386 linux and in an xterm. - Einar Karttunen

Einar Karttunen
It appears that the console is not reset correctly with System.Console.SimpleLineEditor. The terminal does not echo characters until it is reset.
The issue here is the order in which the library makes calls to hSetBuffering and system("stty icanon echo") to reset the terminal. For ghc-6, they are in the wrong order, although for nhc98 and ghc-5, the order doesn't matter. Hence, a simple fix is to swap these calls over, as I have just done in CVS. Regards, Malcolm
participants (2)
-
Einar Karttunen
-
Malcolm Wallace