diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-15 21:55:04 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-15 22:29:26 +0100 |
| commit | fa515a7041bfc4ea27989a5998eb6138867dc76a (patch) | |
| tree | a43403e8fbdaa7fc9d0c5d1a39b145bdc0b6a2d5 /src/Command | |
| parent | a48ad38476fdda3b38384cc9ced60414d7e316df (diff) | |
Types for AnnotatedStatus and ManagedJobStatus
Diffstat (limited to 'src/Command')
| -rw-r--r-- | src/Command/Run.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Command/Run.hs b/src/Command/Run.hs index 72dd4e2..769d2d9 100644 --- a/src/Command/Run.hs +++ b/src/Command/Run.hs @@ -438,7 +438,7 @@ fitToLength maxlen str | len <= maxlen = str <> T.replicate (maxlen - len) " " | otherwise = T.take (maxlen - 1) str <> "…" where len = T.length str -showStatus :: Int -> Bool -> ( JobStatus a, [ OutputFootnote ] ) -> Text +showStatus :: Int -> Bool -> AnnotatedStatus -> Text showStatus width blink ( status, fnotes ) = case status of JobQueued -> " \ESC[94m…\ESC[0m" <> showNotes (width - 2) JobWaiting uses -> "\ESC[94m~" <> fitToLength (width - 1) (T.intercalate "," (map textJobName uses) <> showNotes (width - 1)) <> "\ESC[0m" @@ -463,7 +463,7 @@ showStatus width blink ( status, fnotes ) = case status of showNotes w = fitToLength w $ T.concat $ " " : map showNote fnotes showNote fnote = "[" <> T.pack (maybe "?" (show . tfNumber) (footnoteTerminal fnote)) <> "]" -displayStatusLine :: TerminalOutput -> TerminalLine -> Text -> Text -> [ Maybe (STM ( JobStatus JobOutput, [ OutputFootnote ] )) ] -> IO () +displayStatusLine :: TerminalOutput -> TerminalLine -> Text -> Text -> [ Maybe (STM AnnotatedStatus) ] -> IO () displayStatusLine tout line prefix1 prefix2 statuses = do go "\0" where @@ -484,7 +484,7 @@ displayStatusLine tout line prefix1 prefix2 statuses = do then return () else go cur -waitForJobStatuses :: [ Maybe (STM ( JobStatus a, [ OutputFootnote ] )) ] -> IO () +waitForJobStatuses :: [ Maybe (STM AnnotatedStatus) ] -> IO () waitForJobStatuses mbstatuses = do let statuses = catMaybes mbstatuses atomically $ do |