summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-06-28 18:24:07 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-04 17:57:05 -0400
commit620ee7edc931dc5273dd04880059cc9ec8d41528 (patch)
tree4d3b5fd5693833e5cf928f3ac2183e13f596168d
parent41eb749ada594961fc3276df6bb7319a396a167d (diff)
downloadhaskell-620ee7edc931dc5273dd04880059cc9ec8d41528.tar.gz
ghci: Support :set prompt in multi repl
This adds supports for various :set commands apart from `:set <FLAG>` in multi repl, this includes `:set prompt` and so-on. Fixes #21796
-rw-r--r--ghc/GHCi/UI.hs4
-rw-r--r--testsuite/tests/driver/multipleHomeUnits/multiGHCi.script3
-rw-r--r--testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr1
3 files changed, 6 insertions, 2 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 8fac7da93a..38cce4b1e7 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -236,7 +236,7 @@ ghciCommands = map mkCmd [
("reload!", keepGoingMulti' reloadModuleDefer, noCompletion),
("run", keepGoing runRun, completeFilename),
("script", keepGoing' scriptCmd, completeFilename),
- ("set", keepGoing setCmd, completeSetOptions),
+ ("set", keepGoingMulti setCmd, completeSetOptions),
("seti", keepGoingMulti setiCmd, completeSeti),
("show", keepGoingMulti' showCmd, completeShowOptions),
("showi", keepGoing showiCmd, completeShowiOptions),
@@ -2961,7 +2961,7 @@ setCmd str
setLocalConfigBehaviour $ dropWhile isSpace rest
_ -> case toArgsNoLoc str of
Left err -> liftIO (hPutStrLn stderr err)
- Right wds -> setOptions wds
+ Right wds -> () <$ keepGoing' setOptions wds
setiCmd :: GhciMonad m => String -> m ()
setiCmd "" = GHC.getInteractiveDynFlags >>= liftIO . showDynFlags False
diff --git a/testsuite/tests/driver/multipleHomeUnits/multiGHCi.script b/testsuite/tests/driver/multipleHomeUnits/multiGHCi.script
index 8007f19e51..2af64f99be 100644
--- a/testsuite/tests/driver/multipleHomeUnits/multiGHCi.script
+++ b/testsuite/tests/driver/multipleHomeUnits/multiGHCi.script
@@ -1,4 +1,7 @@
:r
:seti -fprint-explicit-foralls
+:set prompt >>>
+:set -Wall
:t id
:l abc
+
diff --git a/testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr b/testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr
index 5829562213..d90a07b924 100644
--- a/testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr
+++ b/testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr
@@ -1 +1,2 @@
Command is not supported (yet) in multi-mode
+Command is not supported (yet) in multi-mode