summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2017-04-02 10:43:32 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-02 12:01:47 -0400
commitdfac365f69a9380e3c3640b3bfaf9b9157f8d3b9 (patch)
tree29235e374625181b53820407de7c5572a376e9c6 /ghc
parent61ba4518a48727f8cd7b821bd41631da82d37425 (diff)
downloadhaskell-dfac365f69a9380e3c3640b3bfaf9b9157f8d3b9.tar.gz
:cd affects the iserv process too
Test Plan: validate Reviewers: angerman, austin, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3395
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 71be20c20e..deee24ab33 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -1409,6 +1409,11 @@ changeDirectory dir = do
GHC.workingDirectoryChanged
dir' <- expandPath dir
liftIO $ setCurrentDirectory dir'
+ dflags <- getDynFlags
+ -- With -fexternal-interpreter, we have to change the directory of the subprocess too.
+ -- (this gives consistent behaviour with and without -fexternal-interpreter)
+ when (gopt Opt_ExternalInterpreter dflags) $
+ lift $ enqueueCommands ["System.Directory.setCurrentDirectory " ++ show dir']
trySuccess :: GHC.GhcMonad m => m SuccessFlag -> m SuccessFlag
trySuccess act =