[project @ 2001-07-17 14:53:48 by rrt]
authorrrt <unknown>
Tue, 17 Jul 2001 14:53:48 +0000 (14:53 +0000)
committerrrt <unknown>
Tue, 17 Jul 2001 14:53:48 +0000 (14:53 +0000)
Reset the terminal on exit so that ghci doesn't leave it messed up. To see
what I mean, run ghci, then type :q RET, then su return, and start typing a
password. Alarming, isn't it?

This fix needs a patch to the Readline library (next commit).

ghc/compiler/ghci/InteractiveUI.hs

index da64f4b..685cf84 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.80 2001/06/28 11:29:26 simonmar Exp $
+-- $Id: InteractiveUI.hs,v 1.81 2001/07/17 14:53:48 rrt Exp $
 --
 -- GHC Interactive User Interface
 --
@@ -149,6 +149,11 @@ interactiveUI cmstate paths cmdline_libs = do
    startGHCi runGHCi GHCiState{ targets = paths,
                                cmstate = cmstate,
                                options = [] }
+
+#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS
+   Readline.resetTerminal Nothing
+#endif
+
    return ()