Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Functions that return String
values containing codes in accordance with:
(1) standard ECMA-48 Control Functions for Coded Character Sets (5th edition,
1991); or (2) in the case of setTitleCode
, the XTerm control sequence.
The reference used for the codes in this module was http://en.wikipedia.org/wiki/ANSI_escape_sequences.
If module System.Console.ANSI is also imported, this module is intended to be imported qualified, to avoid name clashes with functions which return "" when Windows ANSI terminal support is emulated. e.g.
import qualified System.Console.ANSI.Codes as ANSI
- module System.Console.ANSI.Types
- cursorUpCode :: Int -> String
- cursorDownCode :: Int -> String
- cursorForwardCode :: Int -> String
- cursorBackwardCode :: Int -> String
- cursorUpLineCode :: Int -> String
- cursorDownLineCode :: Int -> String
- setCursorColumnCode :: Int -> String
- setCursorPositionCode :: Int -> Int -> String
- clearFromCursorToScreenEndCode :: String
- clearFromCursorToScreenBeginningCode :: String
- clearScreenCode :: String
- clearFromCursorToLineEndCode :: String
- clearFromCursorToLineBeginningCode :: String
- clearLineCode :: String
- scrollPageUpCode :: Int -> String
- scrollPageDownCode :: Int -> String
- setSGRCode :: [SGR] -> String
- hideCursorCode :: String
- showCursorCode :: String
- setTitleCode :: String -> String
- colorToCode :: Color -> Int
- csi :: [Int] -> String -> String
- sgrToCode :: SGR -> Int
Basic data types
module System.Console.ANSI.Types
Cursor movement by character
Cursor movement by line
Directly changing cursor position
Clearing parts of the screen
Scrolling the screen
Select Graphic Rendition mode: colors and other whizzy stuff
Cursor visibilty changes
Changing the title
Thanks to Brandon S. Allbery and Curt Sampson for pointing me in the right direction on xterm title setting on haskell-cafe. The "0" signifies that both the title and "icon" text should be set: i.e. the text for the window in the Start bar (or similar) as well as that in the actual window title. This is chosen for consistent behaviour between Unixes and Windows.
XTerm control sequence to set the Icon Name and Window Title.
Utilities
colorToCode :: Color -> Int Source #
colorToCode
color
returns the 0-based index of the color (one of the
eight colors in the standard).