Be a bit more flexible in terminal identification for do_bold
authorPepe Iborra <mnislaih@gmail.com>
Thu, 27 Sep 2007 14:15:49 +0000 (14:15 +0000)
committerPepe Iborra <mnislaih@gmail.com>
Thu, 27 Sep 2007 14:15:49 +0000 (14:15 +0000)
  In Os X for instance, by default we have TERM=xterm-color

MERGE TO STABLE

compiler/ghci/InteractiveUI.hs

index 4d3d08d..ec1f4bf 100644 (file)
@@ -1818,7 +1818,7 @@ findBreakByCoord mb_file (line, col) arr
 -- TERM to vt100 for other reasons) we get carets.
 -- We really ought to use a proper termcap/terminfo library.
 do_bold :: Bool
-do_bold = unsafePerformIO mTerm `elem` ["xterm", "linux"]
+do_bold = (`isPrefixOf` unsafePerformIO mTerm) `any` ["xterm", "linux"]
     where mTerm = System.Environment.getEnv "TERM"
                   `Exception.catch` \e -> return "TERM not set"