From 3630677c07768781376242f5c0919a6c9cb5d7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 1 Feb 2026 20:26:42 +0100 Subject: Use FormattedText for terminal prompt --- main/State.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'main/State.hs') 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 -- cgit v1.2.3