diff --git a/hydra-tui/test/Hydra/TUISpec.hs b/hydra-tui/test/Hydra/TUISpec.hs index 29b865bb6c5..747582bf88c 100644 --- a/hydra-tui/test/Hydra/TUISpec.hs +++ b/hydra-tui/test/Hydra/TUISpec.hs @@ -20,11 +20,8 @@ import Graphics.Vty ( defaultConfig, displayContext, initialAssumedState, - outputFd, - outputForConfig, outputPicture, shutdownInput, - termName, ) import Graphics.Vty.Image (DisplayRegion) import Hydra.Cardano.Api (Key (getVerificationKey), Lovelace) @@ -47,6 +44,9 @@ import Hydra.TUI.Options (Options (..)) import HydraNode (HydraClient (HydraClient, hydraNodeId), HydraNodeLog, withHydraNode) import System.FilePath (()) import System.Posix (OpenMode (WriteOnly), closeFd, defaultFileFlags, openFd) +import Graphics.Vty.Platform.Unix.Output (buildOutput) +import Graphics.Vty.Platform.Unix.Settings (defaultSettings) +import Graphics.Vty.Platform.Unix.Input (buildInput) tuiContestationPeriod :: ContestationPeriod tuiContestationPeriod = UnsafeContestationPeriod 10 @@ -238,7 +238,7 @@ withTUITest region action = do findBytes bytes = BS.concat $ BS.drop 1 . BS.dropWhile (/= 109) <$> BS.split 27 bytes buildVty q frameBuffer = do - input <- inputForConfig defaultConfig + input <- buildInput defaultConfig =<< defaultSettings -- NOTE(SN): This is used by outputPicture and we hack it such that it -- always has the initial state to get a full rendering of the picture. That -- way we can capture output bytes line-by-line and drop the cursor moving. @@ -246,7 +246,7 @@ withTUITest region action = do -- NOTE(SN): The null device should allow using this in CI, while we do -- capture the output via `outputByteBuffer` anyway. nullFd <- openFd "/dev/null" WriteOnly defaultFileFlags - realOut <- outputForConfig $ defaultConfig{outputFd = Just nullFd, termName = Just "xterm"} + realOut <- buildOutput =<< defaultSettings closeFd nullFd let output = testOut realOut as frameBuffer pure $