Skip to content

Commit 62ca009

Browse files
mgsloandbaynard
authored andcommitted
"stack ghci" now replaces the process with ghci for signal handling #3821
1 parent db321de commit 62ca009

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ChangeLog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ Other enhancements:
5252

5353
Bug fixes:
5454

55+
* `stack ghci` now replaces the stack process with ghci. This improves
56+
signal handling behavior. In particular, handling of Ctrl-C. To make
57+
this possible, the generated files are now left behind after exit.
58+
The paths are based on hashing file contents, and it's stored in the
59+
system temporary directory, so this shouldn't result in too much
60+
garbage. See
61+
[#3821](https://github.com/commercialhaskell/stack/issues/3821).
5562

5663

5764
## v1.6.5
@@ -108,7 +115,6 @@ Bug fixes:
108115
* `stack ghci` now uses correct paths for autogen files with
109116
[#3791](https://github.com/commercialhaskell/stack/issues/3791)
110117

111-
112118
## v1.6.3.1
113119

114120
Hackage-only release with no user facing changes (updated to build with

src/Stack/Ghci.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Path
3232
import Path.Extra (toFilePathNoTrailingSep)
3333
import Path.IO hiding (withSystemTempDir)
3434
import qualified RIO
35+
import RIO.Process (HasProcessContext, exec, proc, readProcess_)
3536
import Stack.Build
3637
import Stack.Build.Installed
3738
import Stack.Build.Source
@@ -51,7 +52,6 @@ import Stack.Types.PackageIdentifier
5152
import Stack.Types.PackageName
5253
import Stack.Types.Runner
5354
import System.IO (putStrLn, putStr, getLine)
54-
import RIO.Process (HasProcessContext, execSpawn, proc, readProcess_)
5555
import System.IO.Temp (getCanonicalTemporaryDirectory)
5656

5757
#ifndef WINDOWS
@@ -368,7 +368,7 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs extraFiles exposePackages = do
368368
mconcat (intersperse ", " (map (RIO.display . ghciPkgName) pkgs))
369369
let execGhci extras = do
370370
menv <- liftIO $ configProcessContextSettings config defaultEnvSettings
371-
withProcessContext menv $ execSpawn
371+
withProcessContext menv $ exec
372372
(fromMaybe (compilerExeName wc) ghciGhcCommand)
373373
(("--interactive" : ) $
374374
-- This initial "-i" resets the include directories to

0 commit comments

Comments
 (0)