[project @ 2002-07-26 03:06:58 by sof]
authorsof <unknown>
Fri, 26 Jul 2002 03:06:58 +0000 (03:06 +0000)
committersof <unknown>
Fri, 26 Jul 2002 03:06:58 +0000 (03:06 +0000)
interactiveLoop{mingw32}: always show prompt under mingw.

hIsTerminalDevice returns True iff stdin is connected to a Console
under Win32. Which it is when running in a command shell
(DOS,bash etc.), but Emacs sub-shells don't get a Console of their
own when invoked. So, just disable this feature (whose motivation
somewhat escapes me.)

ghc/compiler/ghci/InteractiveUI.hs

index 8cd26ab..de95de8 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-}
 -----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.129 2002/07/17 13:49:15 simonmar Exp $
+-- $Id: InteractiveUI.hs,v 1.130 2002/07/26 03:06:58 sof Exp $
 --
 -- GHC Interactive User Interface
 --
@@ -243,8 +243,14 @@ runGHCi paths dflags = do
        loadModule (unwords paths)
 
   -- enter the interactive loop
+#if defined(mingw32_TARGET_OS)
+   -- always show prompt, since hIsTerminalDevice returns True for Consoles
+   -- only, which we may or may not be running under (cf. Emacs sub-shells.)
+  interactiveLoop True
+#else
   is_tty <- io (hIsTerminalDevice stdin)
   interactiveLoop is_tty
+#endif
 
   -- and finally, exit
   io $ do when (verbosity dflags > 0) $ putStrLn "Leaving GHCi."