mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +03:00
king: New dependency: ansi-terminal
This commit is contained in:
parent
3b1bd6600a
commit
a318462836
@ -402,8 +402,8 @@ localClient doneSignal = fst <$> mkRAcquire start stop
|
||||
-- Redraw the current LineState, maintaining the current curpos
|
||||
termRefreshLine :: T.Terminal -> LineState -> RIO e LineState
|
||||
termRefreshLine t ls = do
|
||||
let line = (lsLine ls)
|
||||
curPos = (lsCurPos ls)
|
||||
let line = lsLine ls
|
||||
curPos = lsCurPos ls
|
||||
ls <- termShowClear t ls
|
||||
ls <- termShowLine t ls line
|
||||
termShowCursor t ls curPos
|
||||
@ -559,7 +559,6 @@ term (tsize, Client{..}) shutdownSTM king enqueueEv =
|
||||
atomically $ give [Term.Blits termBlits]
|
||||
for_ fsWrites handleFsWrite
|
||||
|
||||
|
||||
handleFsWrite :: Blit -> RIO e ()
|
||||
handleFsWrite (Sag path noun) = performPut path (jamBS noun)
|
||||
handleFsWrite (Sav path atom) = performPut path (atomBytes atom)
|
||||
|
@ -12,12 +12,18 @@ module Urbit.Vere.Term.Render
|
||||
, setupTermFromEnv
|
||||
, getCapability
|
||||
, tiGetOutput1
|
||||
, clearScreen
|
||||
, clearLine
|
||||
, cursorRight
|
||||
, cursorLeft
|
||||
, soundBell
|
||||
) where
|
||||
|
||||
import ClassyPrelude
|
||||
|
||||
import qualified System.Console.Terminal.Size as TSize
|
||||
import qualified System.Console.Terminfo.Base as TInfo
|
||||
import qualified System.Console.ANSI as ANSI
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@ -51,6 +57,8 @@ termText = TInfo.termText
|
||||
runTermOutput ∷ Terminal -> TermOutput -> IO ()
|
||||
runTermOutput = TInfo.runTermOutput
|
||||
|
||||
-- Deprecated ------------------------------------------------------------------
|
||||
|
||||
setupTermFromEnv ∷ IO Terminal
|
||||
setupTermFromEnv = TInfo.setupTermFromEnv
|
||||
|
||||
@ -59,3 +67,20 @@ getCapability = TInfo.getCapability
|
||||
|
||||
tiGetOutput1 ∷ TInfo.OutputCap f => String -> Capability f
|
||||
tiGetOutput1 = TInfo.tiGetOutput1
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
clearScreen ∷ IO ()
|
||||
clearScreen = ANSI.clearScreen
|
||||
|
||||
clearLine ∷ IO ()
|
||||
clearLine = ANSI.clearLine
|
||||
|
||||
soundBell ∷ IO ()
|
||||
soundBell = putStr "\BEL"
|
||||
|
||||
cursorLeft ∷ IO ()
|
||||
cursorLeft = ANSI.cursorBackward 1
|
||||
|
||||
cursorRight ∷ IO ()
|
||||
cursorRight = ANSI.cursorForward 1
|
||||
|
@ -30,6 +30,7 @@ tests:
|
||||
|
||||
dependencies:
|
||||
- aeson
|
||||
- ansi-terminal
|
||||
- async
|
||||
- base
|
||||
- base-unicode-symbols
|
||||
|
Loading…
Reference in New Issue
Block a user