FIX #1378 Add option for a shorter banner on GHCi startup
[ghc-hetmet.git] / compiler / ghci / InteractiveUI.hs
index 5407293..2497bad 100644 (file)
@@ -8,7 +8,8 @@
 -----------------------------------------------------------------------------
 module InteractiveUI ( 
        interactiveUI,
-       ghciWelcomeMsg
+       ghciWelcomeMsg,
+       ghciShortWelcomeMsg
    ) where
 
 #include "HsVersions.h"
@@ -41,10 +42,7 @@ import Util
 import FastString
 
 #ifndef mingw32_HOST_OS
-import System.Posix
-#if __GLASGOW_HASKELL__ > 504
-       hiding (getEnv)
-#endif
+import System.Posix hiding (getEnv)
 #else
 import GHC.ConsoleHandler ( flushConsole )
 import System.Win32      ( setConsoleCP, setConsoleOutputCP )
@@ -93,6 +91,10 @@ ghciWelcomeMsg =
  "/ /_\\\\/ __  / /___| |    http://www.haskell.org/ghc/\n"++
  "\\____/\\/ /_/\\____/|_|    Type :? for help.\n"
 
+ghciShortWelcomeMsg =
+    "GHCi, version " ++ cProjectVersion ++
+    ": http://www.haskell.org/ghc/  :? for help"
+
 type Command = (String, String -> GHCi Bool, Bool, String -> IO [String])
 cmdName (n,_,_,_) = n
 
@@ -1471,6 +1473,10 @@ wantNameFromInterpretedModule noCanDo str and_then = do
       []    -> return ()
       (n:_) -> do
             let modl = GHC.nameModule n
+            if not (GHC.isExternalName n)
+               then noCanDo n $ ppr n <>
+                                text " is not defined in an interpreted module"
+               else do
             is_interpreted <- io (GHC.moduleIsInterpreted session modl)
             if not is_interpreted
                then noCanDo n $ text "module " <> ppr modl <>