Skip to content

Commit a9c0eca

Browse files
committed
"stack ghci" now replaces the process with ghci for signal handling #3821
1 parent 9bdacef commit a9c0eca

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ Bug fixes:
8686
we were forgetting to record the result, which meant that all tests
8787
always ran even if they had already passed before. See
8888
[#3770](https://github.com/commercialhaskell/stack/pull/3770).
89+
* `stack ghci` now replaces the stack process with ghci. This improves
90+
signal handling behavior. In particular, handling of Ctrl-C. To make
91+
this possible, the generated files are now left behind after exit.
92+
The paths are based on hashing file contents, and it's stored in the
93+
system temporary directory, so this shouldn't result in too much
94+
garbage. See
95+
[#3821](https://github.com/commercialhaskell/stack/issues/3821).
8996

9097
## v1.6.3
9198

src/Stack/Ghci.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import Stack.Types.PackageName
5050
import Stack.Types.Runner
5151
import System.IO (putStrLn, putStr, getLine)
5252
import System.IO.Temp (getCanonicalTemporaryDirectory)
53-
import RIO.Process (withEnvOverride, execSpawn, execObserve)
53+
import RIO.Process (withEnvOverride, exec, execObserve)
5454

5555
#ifndef WINDOWS
5656
import qualified System.Posix.Files as Posix
@@ -367,7 +367,7 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs extraFiles exposePackages = do
367367
T.intercalate ", " (map (packageNameText . ghciPkgName) pkgs))
368368
let execGhci extras = do
369369
menv <- liftIO $ configEnvOverrideSettings config defaultEnvSettings
370-
withEnvOverride menv $ execSpawn
370+
withEnvOverride menv $ exec
371371
(fromMaybe (compilerExeName wc) ghciGhcCommand)
372372
(("--interactive" : ) $
373373
-- This initial "-i" resets the include directories to

0 commit comments

Comments
 (0)