Skip to content

Commit

Permalink
"stack ghci" now replaces the process with ghci for signal handling #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan authored and dbaynard committed Apr 14, 2018
1 parent db321de commit 62ca009
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ Other enhancements:

Bug fixes:

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


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


## v1.6.3.1

Hackage-only release with no user facing changes (updated to build with
Expand Down
4 changes: 2 additions & 2 deletions src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import Path
import Path.Extra (toFilePathNoTrailingSep)
import Path.IO hiding (withSystemTempDir)
import qualified RIO
import RIO.Process (HasProcessContext, exec, proc, readProcess_)
import Stack.Build
import Stack.Build.Installed
import Stack.Build.Source
Expand All @@ -51,7 +52,6 @@ import Stack.Types.PackageIdentifier
import Stack.Types.PackageName
import Stack.Types.Runner
import System.IO (putStrLn, putStr, getLine)
import RIO.Process (HasProcessContext, execSpawn, proc, readProcess_)
import System.IO.Temp (getCanonicalTemporaryDirectory)

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

0 comments on commit 62ca009

Please sign in to comment.