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-unix-0.2.0.0Haskell2010

Graphics.Vty.Platform.Unix.Input.Terminfo

Terminfo-oriented terminal input parser.

This module is exposed for testing purposes only; applications should never need to import this directly.

  • 6 values
  • Packagevty-unix-0.2.0.0
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTerminfo.hs

Queries the terminal for all capability-based input sequences and then adds on a terminal-dependent input sequence mapping.

For reference see:

Terminfo is incomplete. The vim source implies that terminfo is also incorrect. Vty assumes that the internal terminfo table added to the system-provided terminfo table is correct.

The procedure used here is:

  1. Build terminfo table for all caps. Missing caps are not added.

  2. Add tables for visible chars, esc, del, ctrl, and meta.

  3. Add internally-defined table for given terminal type.

Precedence is currently implicit in the compile algorithm.

A classification table directly generated from terminfo cap strings. These are:

  • ka1 - keypad up-left

  • ka3 - keypad up-right

  • kb2 - keypad center

  • kbs - keypad backspace

  • kbeg - begin

  • kcbt - back tab

  • kc1 - keypad left-down

  • kc3 - keypad right-down

  • kdch1 - delete

  • kcud1 - down

  • kend - end

  • kent - enter

  • kf0 - kf63 - function keys

  • khome - KHome

  • kich1 - insert

  • kcub1 - left

  • knp - next page (page down)

  • kpp - previous page (page up)

  • kcuf1 - right

  • kDC - shift delete

  • kEND - shift end

  • kHOM - shift home

  • kIC - shift insert

  • kLFT - shift left

  • kRIT - shift right

  • kcuu1 - up

The key table applicable to all terminals.

Note that some of these entries are probably only applicable to ANSI/VT100 terminals.

Visible characters in the ISO-8859-1 and UTF-8 common set.

We limit to < 0xC1. The UTF8 sequence detector will catch all values 0xC2 and above before this classify table is reached.