From 4fdfab66df9bec999c66d9470b8cdec48b002049 Mon Sep 17 00:00:00 2001 From: Benjamin Summers Date: Tue, 17 Sep 2019 22:06:40 -0700 Subject: [PATCH] Minor --- pkg/king/lib/Vere/Term.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/king/lib/Vere/Term.hs b/pkg/king/lib/Vere/Term.hs index b0fe307b9f..c1b4fd5eef 100644 --- a/pkg/king/lib/Vere/Term.hs +++ b/pkg/king/lib/Vere/Term.hs @@ -226,13 +226,6 @@ initializeLocalTerminal = fst <$> mkRAcquire start stop threadDelay rest loop - writeTrace :: T.Terminal -> LineState -> Text -> RIO e LineState - writeTrace t ls p = do - io $ T.runTermOutput t $ termText "\r" - runMaybeTermOutput t vtClearToBegin - io $ T.runTermOutput t $ termText p - termRefreshLine t ls - -- Writes data to the terminal. Both the terminal reading, normal logging, -- and effect handling can all emit bytes which go to the terminal. writeTerminal :: T.Terminal -> TQueue DrvEv -> TMVar () -> RIO e () @@ -245,6 +238,13 @@ initializeLocalTerminal = fst <$> mkRAcquire start stop io $ T.runTermOutput t $ termText "\r\n" pure ls + writeTrace :: LineState -> Text -> RIO e LineState + writeTrace ls p = do + io $ T.runTermOutput t $ termText "\r" + runMaybeTermOutput t vtClearToBegin + io $ T.runTermOutput t $ termText p + termRefreshLine t ls + {- Figure out how long to wait to show the spinner. When we don't have a vane name to display, we assume its a user @@ -289,7 +289,7 @@ initializeLocalTerminal = fst <$> mkRAcquire start stop execEv :: LineState -> DrvEv -> RIO e LineState execEv ls = \case DEBlits bs -> foldM (writeBlit t) ls bs - DETrace p -> writeTrace t ls p + DETrace p -> writeTrace ls p DEBlank -> writeBlank ls DESpinr (Just txt) -> doSpin ls txt DESpinr Nothing -> unspin ls