Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHCup.Utils.Output
Documentation
fitsInTerminal :: [Text] -> IO (Maybe Bool) Source #
Checks whether the given text lines fit in the terminal window.
Returns Nothing
if the terminal size could not be determined (e.g. bc we're
part of a pipe).
fitsInTerminal' :: Text -> IO (Maybe Bool) Source #
Like fitsInTerminal
, but takes a single text blob.
strWidth :: String -> Int Source #
Calculate the render width of a string, considering wide characters (counted as double width), ANSI escape codes (not counted), and line breaks (in a multi-line string, the longest line determines the width).