Commit 4d70840d authored by Benno Fünfstück's avatar Benno Fünfstück Committed by Krzysztof Gogolewski

Fix #5209: Reset GHCi prompt in multiline mode

GHCi didn't reset the multiline prompt when an exception (in particular,
the UserInterrupt exception) occured. This commit uses `finally` to
reset the prompt in all cases.
parent 9e10d188
......@@ -726,8 +726,7 @@ runOneCommand eh gCmd = do
st <- lift getGHCiState
let p = prompt st
lift $ setGHCiState st{ prompt = prompt2 st }
mb_cmd <- collectCommand q ""
lift $ getGHCiState >>= \st' -> setGHCiState st'{ prompt = p }
mb_cmd <- collectCommand q "" `GHC.gfinally` lift (getGHCiState >>= \st' -> setGHCiState st' { prompt = p })
return mb_cmd
-- we can't use removeSpaces for the sublines here, so
-- multiline commands are somewhat more brittle against
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment