diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-06-28 18:24:07 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-04 17:57:05 -0400 |
commit | 620ee7edc931dc5273dd04880059cc9ec8d41528 (patch) | |
tree | 4d3b5fd5693833e5cf928f3ac2183e13f596168d | |
parent | 41eb749ada594961fc3276df6bb7319a396a167d (diff) | |
download | haskell-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.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/driver/multipleHomeUnits/multiGHCi.script | 3 | ||||
-rw-r--r-- | testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr | 1 |
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 |