summaryrefslogtreecommitdiff
path: root/ghc/GHCi/UI.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/GHCi/UI.hs')
-rw-r--r--ghc/GHCi/UI.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index b2909c2441..77801019ee 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -427,13 +427,14 @@ defFullHelpText =
findEditor :: IO String
findEditor = do
- getEnv "EDITOR"
- `catchIO` \_ -> do
+ getEnv "VISUAL" <|> getEnv "EDITOR" <|> defaultEditor
+ where
+ defaultEditor = do
#if defined(mingw32_HOST_OS)
- win <- System.Win32.getWindowsDirectory
- return (win </> "notepad.exe")
+ win <- System.Win32.getWindowsDirectory
+ return (win </> "notepad.exe")
#else
- return ""
+ return ""
#endif
default_progname, default_stop :: String