summaryrefslogtreecommitdiff
path: root/main/State.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-02-01 20:26:42 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2026-02-02 22:02:45 +0100
commit3630677c07768781376242f5c0919a6c9cb5d7fe (patch)
tree0836480692fd2bd80c24a2e72d69a90c6bba0905 /main/State.hs
parent0c36f490719f613dc23b6632a4098bd17fb0ab7c (diff)
Use FormattedText for terminal promptHEADmaster
Diffstat (limited to 'main/State.hs')
-rw-r--r--main/State.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/main/State.hs b/main/State.hs
index 5d66ba9..0e20320 100644
--- a/main/State.hs
+++ b/main/State.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE OverloadedStrings #-}
+
module State (
loadLocalStateHead,
createLocalStateHead,
@@ -20,6 +22,7 @@ import Erebos.PubKey
import Erebos.State
import Erebos.Storable
import Erebos.Storage
+import Erebos.TextFormat
import Terminal
@@ -96,12 +99,12 @@ interactiveIdentityUpdate :: (Foldable f, MonadStorage m, MonadIO m, MonadError
interactiveIdentityUpdate term fidentity = do
identity <- mergeIdentity fidentity
name <- liftIO $ do
- setPrompt term $ T.unpack $ T.concat $ concat
- [ [ T.pack "Name" ]
+ setPrompt term $ mconcat $ concat
+ [ [ "Name" ]
, case idName identity of
- Just name -> [T.pack " [", name, T.pack "]"]
- Nothing -> []
- , [ T.pack ": " ]
+ Just name -> [ " [", plainText name, "]" ]
+ Nothing -> []
+ , [ ": " ]
]
getInputLine term $ KeepPrompt . maybe T.empty T.pack