From f1f62e00559d5c68a5e7b1246208391835a13d0d Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Mon, 25 Aug 2025 02:42:03 +0000 Subject: Adds color to `hsm-repl` prompt --- hsm-repl/Hsm/Repl.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hsm-repl/Hsm') diff --git a/hsm-repl/Hsm/Repl.hs b/hsm-repl/Hsm/Repl.hs index 46261d6..45a2cf2 100644 --- a/hsm-repl/Hsm/Repl.hs +++ b/hsm-repl/Hsm/Repl.hs @@ -15,6 +15,7 @@ import GHC.TypeLits (KnownSymbol, Symbol, symbolVal) import Generic.Data.Function.Common.Generic.Meta (KnownSymbols, symbolVals) import Hsm.Log (Log, Severity(Attention, Info, Trace), logBlock, logMsg) import Language.Haskell.Interpreter (GhcError(errMsg), InterpreterError(WontCompile), as, interpret, runInterpreter, setImports) +import String.ANSI (blue) import System.Console.Haskeline (defaultSettings, getInputLine, handleInterrupt, withInterrupt) import System.Console.Haskeline.IO (InputState, cancelInput, initializeInput, queryInput) @@ -33,7 +34,7 @@ repl = query >>= maybe (return Nothing) parse query = do Repl inputState <- getStaticRep logMsg Trace $ "Expecting a value of type: " <> show (typeRep $ Proxy @t) - unsafeEff_ . queryInput inputState . handleInterrupt (return Nothing) . withInterrupt . getInputLine $ symbolVal (Proxy @p) + unsafeEff_ . queryInput inputState . handleInterrupt (return Nothing) . withInterrupt . getInputLine . blue $ symbolVal (Proxy @p) parse string = do logMsg Trace $ "Parsing string: " <> string eitherValue <- -- cgit v1.2.1