Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides functions for accessing the current terminal or a specific terminal device.
See also:
- Graphics.Vty.Output: This instantiates an abtract interface
to the terminal based on the
TERM
andCOLORTERM
environment variables. - Graphics.Vty.Output.Interface: Defines the generic interface all terminal modules need to implement.
- Graphics.Vty.Output.TerminfoBased: Defines a terminal instance that uses terminfo for all control strings. No attempt is made to change the character set to UTF-8 for these terminals.
- Graphics.Vty.Output.XTermColor: This module contains an
interface suitable for xterm-like terminals. These are the terminals
where
TERM
begins withxterm
. This does use terminfo for as many control codes as possible.
Synopsis
- outputForConfig :: Config -> IO Output
- setCursorPos :: Output -> Int -> Int -> IO ()
- hideCursor :: Output -> IO ()
- showCursor :: Output -> IO ()
Documentation
outputForConfig :: Config -> IO Output Source #
Returns an Output
for the terminal specified in Config
.
The specific Output implementation used is hidden from the API user. All terminal implementations are assumed to perform more, or less, the same. Currently, all implementations use terminfo for at least some terminal specific information.
If a terminal implementation is developed for a terminal without terminfo support then Vty should work as expected on that terminal.
Selection of a terminal is done as follows:
- If TERM starts with "xterm", "screen" or "tmux", use XTermColor.
- otherwise use the TerminfoBased driver.
setCursorPos :: Output -> Int -> Int -> IO () Source #
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
.
hideCursor :: Output -> IO () Source #
Hides the cursor.
showCursor :: Output -> IO () Source #
Shows the cursor.