HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulevty-6.5Haskell2010

Graphics.Vty.Output

This module provides an abstract interface for performing terminal output and functions for accessing the current terminal or a specific terminal device.

  • 4 types
  • 7 values
  • Packagevty-6.5
  • Exports11
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceOutput.hs
datadata Output
#

The library's device output abstraction. Platform-specific implementations must implement an Output and provide it to mkVtyFromPair.

Constructors

  • Output
    • terminalID :: String

      Text identifier for the output device. Used for debugging.

    • releaseTerminal :: IO ()

      Release the terminal just prior to application exit and reset it to its state prior to application startup.

    • reserveDisplay :: IO ()

      Clear the display and initialize the terminal to some initial display state.

      The expectation of a program is that the display starts in some The initial state. initial state would consist of fixed values:

      • cursor at top left

      • UTF-8 character encoding

      • drawing characteristics are the default

    • releaseDisplay :: IO ()

      Return the display to the state before reserveDisplay If no previous state then set the display state to the initial state.

    • setDisplayBounds :: (Int, Int) -> IO ()

      Sets the current display bounds (width, height).

    • displayBounds :: IO DisplayRegion

      Returns the current display bounds.

    • outputByteBuffer :: ByteString -> IO ()

      Output the bytestring to the terminal device.

    • supportsCursorVisibility :: Bool

      Specifies whether the cursor can be shown / hidden.

    • supportsMode :: Mode -> Bool

      Indicates support for terminal modes for this output device.

    • setMode :: Mode -> Bool -> IO ()

      Enables or disables a mode (does nothing if the mode is unsupported).

    • getModeStatus :: Mode -> IO Bool

      Returns whether a mode is enabled.

    • assumedStateRef :: IORef AssumedState
    • mkDisplayContext :: Output -> DisplayRegion -> IO DisplayContext

      Acquire display access to the given region of the display. Currently all regions have the upper left corner of (0,0) and the lower right corner at (max displayWidth providedWidth, max displayHeight providedHeight)

    • ringTerminalBell :: IO ()

      Ring the terminal bell if supported.

    • supportsBell :: IO Bool

      Returns whether the terminal has an audio bell feature.

    • supportsItalics :: IO Bool

      Returns whether the terminal supports italicized text.

      This is terminal-dependent and should make a best effort to determine whether this feature is supported, but even if the terminal advertises support (e.g. via terminfo) that might not be a reliable indicator of whether the feature will work as desired.

    • supportsStrikethrough :: IO Bool

      Returns whether the terminal supports strikethrough text.

      This is terminal-dependent and should make a best effort to determine whether this feature is supported, but even if the terminal advertises support (e.g. via terminfo) that might not be a reliable indicator of whether the feature will work as desired.

    • outputColorMode :: ColorMode

      Returns how many colors the terminal supports.

    • setOutputWindowTitle :: String -> IO ()

      Set the output's window title, if any.

datadata DisplayContext
#

Constructors

datadata Mode
#

Modal terminal features that can be enabled and disabled.

Constructors

  • Mouse

    Mouse mode (whether the terminal is configured to provide mouse input events)

  • BracketedPaste

    Paste mode (whether the terminal is configured to provide events on OS pastes)

  • Focus

    Focus-in/focus-out events (whether the terminal is configured to provide events on focus change)

Instances3Eq, Read, Show
  • Eq ModeDefined in vty-6.5 · Graphics.Vty.Output
  • Read ModeDefined in vty-6.5 · Graphics.Vty.Output
  • Show ModeDefined in vty-6.5 · Graphics.Vty.Output
valueoutputPicture :: DisplayContext -> Picture -> IO ()
#

Displays the given Picture.

  1. The image is cropped to the display size.

  2. Converted into a sequence of attribute changes and text spans.

  3. The cursor is hidden.

  4. Serialized to the display.

  5. The cursor is then shown and positioned or kept hidden.

Not all terminals support all display attributes. This filters a display attribute to what the given terminal can display.

valuesetCursorPos :: Output -> Int -> Int -> IO ()
#

Sets the cursor position to the given output column and row.

This is not necessarily the same as the character position with the same coordinates. Characters can be a variable number of columns in width.

Currently, the only way to set the cursor position to a given character coordinate is to specify the coordinate in the Picture instance provided to outputPicture or refresh.