[vte/wip/terminfo] all: Use terminfo instead of termcap



commit b92d27820194b08db57f969d6a5a40540b8a8d13
Author: Christian Persch <chpe gnome org>
Date:   Fri Apr 18 22:00:48 2014 +0200

    all: Use terminfo instead of termcap
    
    https://bugzilla.gnome.org/show_bug.cgi?id=169295

 Makefile.am              |    2 +-
 configure.ac             |   54 +--
 src/Makefile.am          |  147 +++++--
 src/app.vala             |    8 +-
 src/caps.c               |  355 -----------------
 src/caps.h               |   10 -
 src/interpret.c          |   18 +-
 src/iso2022.c            |    2 +-
 src/keymap.c             |  297 +++++---------
 src/keymap.h             |    6 +-
 src/matcher.c            |  146 ++++---
 src/matcher.h            |    5 +-
 src/table.c              |    2 +-
 src/vte-private.h        |    6 +-
 src/vte.c                |  113 +++---
 src/vte.gresource.xml.in |    3 -
 src/vteconv.c            |    7 +-
 src/vteseq.c             |   73 ++--
 src/vtetc.c              |  648 -------------------------------
 src/vtetc.h              |   59 ---
 src/vteti.c              |  628 ++++++++++++++++++++++++++++++
 src/vteti.h              |   94 +++++
 src/vtetivars.awk        |   83 ++++
 src/vtetivars.h          |  966 ++++++++++++++++++++++++++++++++++++++++++++++
 termcaps/Makefile.am     |    4 -
 termcaps/xterm           |   33 --
 termcaps/xterm-color     |   27 --
 termcaps/xterm.baseline  |   35 --
 28 files changed, 2192 insertions(+), 1639 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 4230607..32f30a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
 
-SUBDIRS = src termcaps po doc perf
+SUBDIRS = src po doc perf
 
 EXTRA_DIST = \
        MAINTAINERS \
diff --git a/configure.ac b/configure.ac
index a28abe2..937670f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,8 +192,6 @@ GLIB_REQUIRED=2.40.0
 GIO_REQUIRED=2.40.0
 PANGO_REQUIRED=1.22.0
 AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK multihead-safe APIs.])
-PKG_CHECK_MODULES(GLIB,[glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED])
-PKG_CHECK_MODULES(GTK,[glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED gtk+-$GTK_API_VERSION 
= $GTK_REQUIRED])
 
 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
@@ -232,52 +230,24 @@ fi
 AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
 AC_CHECK_FUNCS([ceil floor round])
 
-# Look for tgetent
-
-AC_CHECK_FUNC([tgetent],[vte_cv_termcap_lib=libc],
-  [AC_CHECK_LIB([ncurses],[tgetent],[vte_cv_termcap_lib=libncurses],
-    [AC_CHECK_LIB([tinfo],[tgetent],[vte_cv_termcap_lib=libtinfo],
-      [AC_CHECK_LIB([curses],[tgetent],[vte_cv_termcap_lib=libcurses],
-        [AC_CHECK_LIB([termcap],[tgetent],[vte_cv_termcap_lib=libtermcap],
-          [vte_cv_termcap_lib=])])])])])
-
-case "$vte_cv_termcap_lib" in
-  libc)       # FIXME: which headers to include here?
-              ;;
-  libncurses) # We need ncurses.h and term.h, or ncurses/curses.h and ncurses/term.h
-              AC_CHECK_HEADERS([ncurses.h term.h],[],
-                [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[],
-                  [AC_MSG_ERROR([ncurses headers not found])])])
-              LIBS="-lncurses $LIBS"
-              ;;
-  libtinfo)   # Need ncurses/curses.h and ncurses/term.h
-              AC_CHECK_HEADERS([ncurses.h term.h],[],
-                [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[],
-                  [AC_MSG_ERROR([ncurses headers not found])])])
-              LIBS="-ltinfo $LIBS"
-              ;;
-  libcurses)  # Need curses.h and term.h
-              AC_CHECK_HEADERS([curses.h term.h],[],
-                [AC_MSG_ERROR([curses headers not found])],
-                [[#ifdef HAVE_CURSES_H
-                  #include <curses.h>
-                  #endif]])
-              LIBS="-lcurses $LIBS"
-              ;;
-  libtermcap) # Need termcap.h
-              AC_CHECK_HEADERS([termcap.h],[],
-                [AC_MSG_ERROR([termcap headers not found])])
-              LIBS="-ltermcap $LIBS"
-              ;;
-  *)          AC_MSG_ERROR([tgetent not found in any library]) ;;
-esac
-
 # Search for the required modules.
 
 VTE_PKGS="glib-2.0 >= $GLIB_REQUIRED gobject-2.0 pango >= $PANGO_REQUIRED gtk+-$GTK_API_VERSION >= 
$GTK_REQUIRED gobject-2.0 gio-2.0 gio-unix-2.0"
 PKG_CHECK_MODULES([VTE],[$VTE_PKGS])
 AC_SUBST([VTE_PKGS])
 
+PKG_CHECK_MODULES([TERMINFO],[tinfo])
+PKG_CHECK_MODULES([GLIB],[glib-2.0 >= $GLIB_REQUIRED])
+PKG_CHECK_MODULES([GOBJECT],[gobject-2.0])
+PKG_CHECK_MODULES([GTK],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED])
+
+# terminfo
+
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $TERMINFO_CFLAGS"
+AC_CHECK_HEADERS([ncurses.h term.h tic.h],[],[AC_MSG_ERROR([ncurses terminfo headers not found])])
+CFLAGS="$save_CFLAGS"
+
 wcs_funcs_includes="
 #ifdef HAVE_STRING_H
 # if !STDC_HEADERS && HAVE_MEMORY_H
diff --git a/src/Makefile.am b/src/Makefile.am
index 3fc5d29..63b526c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,11 @@
-
-EXTRA_DIST = iso2022.txt
-
 bin_PROGRAMS =
 noinst_PROGRAMS =
 
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
+
 # The library
 
 headerdir = $(includedir)/vte-$(VTE_API_VERSION)/vte
@@ -73,8 +75,9 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_SOURCES = \
        vtestream.h \
        vtestream-base.h \
        vtestream-file.h \
-       vtetc.c \
-       vtetc.h \
+       vteti.c \
+       vteti.h \
+       vtetivars.h \
        vtetree.c \
        vtetree.h \
        vtetypebuiltins.c \
@@ -96,8 +99,11 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_CPPFLAGS = \
        -DVTE_COMPILATION \
        $(AM_CPPFLAGS)
 
-libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_CFLAGS = $(VTE_CFLAGS) $(AM_CFLAGS)
-libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LIBADD = $(VTE_LIBS)
+libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_CFLAGS = \
+       $(VTE_CFLAGS) \
+       $(TERMINFO_CFLAGS) \
+       $(AM_CFLAGS)
+
 libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LDFLAGS = \
        $(VTE_LDFLAGS) \
        -version-info $(LT_VERSION_INFO) \
@@ -105,14 +111,17 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LDFLAGS = \
        @LIBTOOL_EXPORT_OPTIONS@ @LIBTOOL_FLAGS@ \
        $(AM_LDFLAGS)
 
+libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LIBADD = \
+       $(VTE_LIBS) \
+       $(TERMINFO_LIBS)
 
 # Generated sources
 
 VTESEQ_BUILTSOURCES = vteseq-list.h vteseq-2.c vteseq-n.c
 BUILT_SOURCES = box_drawing.h marshal.c marshal.h vtetypebuiltins.c vtetypebuiltins.h vteresources.c 
$(VTESEQ_BUILTSOURCES)
-MAINTAINERCLEANFILES = $(VTESEQ_BUILTSOURCES)
-EXTRA_DIST += $(VTESEQ_BUILTSOURCES) box_drawing.txt
-CLEANFILES = box_drawing.h marshal.c marshal.h vtetypebuiltins.c vtetypebuiltins.h stamp-vtetypebuiltins.h 
vteresources.c
+MAINTAINERCLEANFILES+ = $(VTESEQ_BUILTSOURCES)
+EXTRA_DIST += $(VTESEQ_BUILTSOURCES) box_drawing.txt iso2022.txt vtetivars.awk
+CLEANFILES += box_drawing.h marshal.c marshal.h vtetypebuiltins.c vtetypebuiltins.h stamp-vtetypebuiltins.h 
vteresources.c
 
 box_drawing.h: box_drawing.txt
        $(AM_V_GEN) $(srcdir)/box_drawing_generate.sh < $< > $@
@@ -152,6 +161,10 @@ vteseq-list.h: vteseq-2.gperf vteseq-n.gperf
 vteresources.c: vte.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies 
vte.gresource.xml)
        $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir . --generate --c-name vte $<
 
+vtetivars.h: vtetivars.awk
+       $(AM_V_GEN) $(top_srcdir)/missing --run awk -f $< Caps > $  tmp && \
+       mv -f $  tmp $@
+
 # introspection
 
 INTROSPECTION_GIRS =
@@ -283,19 +296,19 @@ TEST_SH = \
        $(NULL)
 EXTRA_DIST += $(TEST_SH)
 
-check_PROGRAMS = dumpkeys iso2022 reflect-text-view reflect-vte mev table trie xticker vteconv vtetc
+check_PROGRAMS = dumpkeys iso2022 reflect-text-view reflect-vte mev table trie xticker vteconv vteti
 TESTS = table trie $(TEST_SH)
 
 AM_CFLAGS = $(GLIB_CFLAGS)
 LDADD = $(GLIB_LIBS)
 
-reflect_text_view_CPPFLAGS = -DUSE_TEXT_VIEW
-reflect_text_view_CFLAGS = $(VTE_CFLAGS)
+reflect_text_view_CPPFLAGS = -DUSE_TEXT_VIEW $(AM_CPPFLAGS)
+reflect_text_view_CFLAGS = $(VTE_CFLAGS) $(AM_CFLAGS)
 reflect_text_view_SOURCES = reflect.c
 reflect_text_view_LDADD = $(VTE_LIBS)
 
-reflect_vte_CPPFLAGS = -DUSE_VTE
-reflect_vte_CFLAGS = $(VTE_CFLAGS)
+reflect_vte_CPPFLAGS = -DUSE_VTE $(AM_CPPFLAGS)
+reflect_vte_CFLAGS = $(VTE_CFLAGS) $(AM_CFLAGS)
 reflect_vte_SOURCES = reflect.c
 reflect_vte_LDADD = libvte-$(VTE_API_VERSION).la $(VTE_LIBS)
 
@@ -315,9 +328,9 @@ interpret_SOURCES = \
        trie.h \
        vteconv.c \
        vteconv.h \
-       vteresources.c \
-       vtetc.c \
-       vtetc.h \
+       vteti.c \
+       vteti.h \
+       vtetivars.h \
        vtetree.c \
        vtetree.h \
        interpret.c
@@ -325,8 +338,16 @@ interpret_CPPFLAGS = \
        -DINTERPRET_MAIN \
        -DVTE_API_VERSION=\"$(VTE_API_VERSION)\" \
        $(AM_CPPFLAGS)
-interpret_CFLAGS = $(GTK_CFLAGS)
-interpret_LDADD = $(GTK_LIBS)
+interpret_CFLAGS = \
+       $(GLIB_CFLAGS) \
+       $(GOBJECT_CFLAGS) \
+       $(GTK_CFLAGS) \
+       $(TERMINFO_CFLAGS) \
+       $(AM_CFLAGS)
+interpret_LDADD = \
+       $(GLIB_LIBS) \
+       $(GOBJECT_LIBS) \
+       $(TERMINFO_LIBS)
 
 iso2022_SOURCES = \
        buffer.h \
@@ -344,13 +365,23 @@ iso2022_SOURCES = \
        trie.h \
        vteconv.c \
        vteconv.h \
-       vtetc.c \
-       vtetc.h \
+       vteti.c \
+       vteti.h \
+       vtetivars.h \
        vtetree.c \
        vtetree.h
-iso2022_CPPFLAGS = -DISO2022_MAIN
-iso2022_CFLAGS = $(GTK_CFLAGS)
-iso2022_LDADD = $(GTK_LIBS)
+iso2022_CPPFLAGS = \
+       -DISO2022_MAIN \
+       $(AM_CPPFLAGS)
+iso2022_CFLAGS = \
+       $(GLIB_CFLAGS) \
+       $(GTK_CFLAGS) \
+       $(TERMINFO_CFLAGS) \
+       $(AM_CFLAGS)
+iso2022_LDADD = \
+       $(GLIB_LIBS) \
+       $(GOBJECT_LIBS) \
+       $(TERMINFO_LIBS)
 
 slowcat_SOURCES = \
        slowcat.c
@@ -369,11 +400,21 @@ table_SOURCES = \
        trie.h \
        vteconv.c \
        vteconv.h \
-       vtetc.c \
-       vtetc.h
-table_CPPFLAGS = -DTABLE_MAIN
-table_CFLAGS = $(VTE_CFLAGS)
-table_LDADD = $(VTE_LIBS)
+       vteti.c \
+       vteti.h \
+       vtetivars.h \
+       $(NULL)
+table_CPPFLAGS = \
+       -DTABLE_MAIN \
+       $(AM_CPPFLAGS)
+table_CFLAGS = \
+       $(GLIB_CFLAGS) \
+       $(TERMINFO_CFLAGS) \
+       $(AM_CFLAGS)
+table_LDADD = \
+       $(GLIB_LIBS) \
+       $(GOBJECT_LIBS) \
+       $(TERMINFO_LIBS)
 
 trie_SOURCES = \
        trie.c \
@@ -389,18 +430,44 @@ trie_SOURCES = \
        table.h \
        vteconv.c \
        vteconv.h \
-       vtetc.c \
-       vtetc.h 
-trie_CPPFLAGS = -DTRIE_MAIN
-trie_CFLAGS = $(VTE_CFLAGS)
-trie_LDADD = $(VTE_LIBS)
-
-vtetc_SOURCES = vtetc.c vtetc.h debug.c debug.h
-vtetc_CPPFLAGS = -DTERMCAP_MAIN
+       vteti.c \
+       vteti.h \
+       vtetivars.h \
+       $(NULL)
+trie_CPPFLAGS = \
+       -DTRIE_MAIN \
+       $(AM_CPPFLAGS)
+trie_CFLAGS = \
+       $(GLIB_CFLAGS) \
+       $(GOBJECT_CFLAGS) \
+       $(TERMINFO_CFLAGS) \
+       $(AM_CFLAGS)
+trie_LDADD = \
+       $(GLIB_LIBS) \
+       $(GOBJECT_LIBS) \
+       $(TERMINFO_LIBS)
+
+vteti_SOURCES = \
+       debug.c \
+       debug.h \
+       vteti.c \
+       vteti.h \
+       vtetivars.h \
+       $(NULL)
+vteti_CPPFLAGS = \
+       -DTERMINFO_MAIN \
+       $(AM_CPPFLAGS)
+vteti_CFLAGS = \
+       $(GLIB_CFLAGS) \
+       $(TERMINFO_CFLAGS) \
+       $(AM_CFLAGS)
+vteti_LDADD = \
+       $(GLIB_LIBS) \
+       $(TERMINFO_LIBS)
 
 vteconv_SOURCES = buffer.h debug.c debug.h vteconv.c vteconv.h
-vteconv_CPPFLAGS = -DVTECONV_MAIN
-vteconv_CFLAGS = $(VTE_CFLAGS)
+vteconv_CPPFLAGS = -DVTECONV_MAIN $(AM_CPPFLAGS)
+vteconv_CFLAGS = $(VTE_CFLAGS) $(AM_CFLAGS)
 vteconv_LDADD = $(VTE_LIBS)
 
 dumpkeys_SOURCES = dumpkeys.c
diff --git a/src/app.vala b/src/app.vala
index f190f1d..424ba15 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -102,8 +102,8 @@ class Window : Gtk.ApplicationWindow
                if (App.Options.no_double_buffer)
                        terminal.set_double_buffered(true);
 
-               if (App.Options.termcap != null)
-                       terminal.set_emulation(App.Options.termcap);
+               if (App.Options.term != null)
+                       terminal.set_emulation(App.Options.term);
                if (App.Options.encoding != null)
                        terminal.set_encoding(App.Options.encoding);
 
@@ -564,7 +564,7 @@ class App : Gtk.Application
                private static string? pty_flags_string = null;
                public static bool reverse = false;
                public static int scrollback_lines = 512;
-               public static string? termcap = null;
+               public static string? term = null;
                public static int transparency_percent = 0;
                public static bool version = false;
                public static string? working_directory = null;
@@ -757,7 +757,7 @@ class App : Gtk.Application
                          "Reverse foreground/background colors", null },
                        { "scrollback-lines", 'n', 0, OptionArg.INT, ref scrollback_lines,
                          "Specify the number of scrollback-lines", null },
-                       { "termcap", 't', 0, OptionArg.STRING, ref termcap,
+                       { "term", 't', 0, OptionArg.STRING, ref term,
                          "Specify the terminal emulation to use", null },
                        { "transparent", 'T', 0, OptionArg.INT, ref transparency_percent,
                          "Enable the use of a transparent background", "0..100" },
diff --git a/src/caps.c b/src/caps.c
index 137cea5..acc34bc 100644
--- a/src/caps.c
+++ b/src/caps.c
@@ -39,327 +39,6 @@
 #define SO  "\016"
 #define SI  "\017"
 
-/* This list combined from the Linux termcap(5) man page, and
- * termcap_&_terminfo by Strang, Mui, and O'Reilly. */
-struct _vte_capability_quark _vte_terminal_capability_strings[] = {
-       {"!1", TRUE, 0},
-       {"!2", TRUE, 0},
-       {"!3", TRUE, 0},
-
-       {"#1", TRUE, 0},
-       {"#2", TRUE, 0},
-       {"#3", TRUE, 0},
-       {"#4", TRUE, 0},
-
-       {"%0", TRUE, 0},
-       {"%1", TRUE, 0},
-       {"%2", TRUE, 0},
-       {"%3", TRUE, 0},
-       {"%4", TRUE, 0},
-       {"%5", TRUE, 0},
-       {"%6", TRUE, 0},
-       {"%7", TRUE, 0},
-       {"%8", TRUE, 0},
-       {"%9", TRUE, 0},
-       {"%a", TRUE, 0},
-       {"%b", TRUE, 0},
-       {"%c", TRUE, 0},
-       {"%d", TRUE, 0},
-       {"%e", TRUE, 0},
-       {"%f", TRUE, 0},
-       {"%g", TRUE, 0},
-       {"%h", TRUE, 0},
-       {"%i", TRUE, 0},
-       {"%j", TRUE, 0},
-
-       {"&0", TRUE, 0},
-       {"&1", TRUE, 0},
-       {"&2", TRUE, 0},
-       {"&3", TRUE, 0},
-       {"&4", TRUE, 0},
-       {"&5", TRUE, 0},
-       {"&6", TRUE, 0},
-       {"&7", TRUE, 0},
-       {"&8", TRUE, 0},
-       {"&9", TRUE, 0},
-
-       {"*0", TRUE, 0},
-       {"*1", TRUE, 0},
-       {"*2", TRUE, 0},
-       {"*3", TRUE, 0},
-       {"*4", TRUE, 0},
-       {"*5", TRUE, 0},
-       {"*6", TRUE, 0},
-       {"*7", TRUE, 0},
-       {"*8", TRUE, 0},
-       {"*9", TRUE, 0},
-
-       {"@0", TRUE, 0},
-       {"@1", TRUE, 0},
-       {"@2", TRUE, 0},
-       {"@3", TRUE, 0},
-       {"@4", TRUE, 0},
-       {"@5", TRUE, 0},
-       {"@6", TRUE, 0},
-       {"@7", TRUE, 0},
-       {"@8", TRUE, 0},
-       {"@9", TRUE, 0},
-
-       {"ae", FALSE, 0},
-       {"al", FALSE, 0},
-       {"AL", FALSE, 0},
-       {"as", FALSE, 0},
-
-       {"bc", FALSE, 0},
-       {"bl", FALSE, 0},
-       {"bt", FALSE, 0},
-
-       {"cb", FALSE, 0},
-       {"cc", FALSE, 0},
-       {"cd", FALSE, 0},
-       {"ce", FALSE, 0},
-       {"ch", FALSE, 0},
-       {"cl", FALSE, 0},
-       {"cm", FALSE, 0},
-       {"CM", FALSE, 0},
-       {"cr", FALSE, 0},
-       {"cs", FALSE, 0},
-       {"ct", FALSE, 0},
-       {"cv", FALSE, 0},
-
-       {"dc", FALSE, 0},
-       {"DC", FALSE, 0},
-       {"dl", FALSE, 0},
-       {"DL", FALSE, 0},
-       {"dm", FALSE, 0},
-       {"do", FALSE, 0},
-       {"DO", FALSE, 0},
-       {"ds", FALSE, 0},
-
-       {"eA", FALSE, 0},
-       {"ec", FALSE, 0},
-       {"ed", FALSE, 0},
-       {"ei", FALSE, 0},
-
-       {"F1", TRUE, 0},
-       {"F2", TRUE, 0},
-       {"F3", TRUE, 0},
-       {"F4", TRUE, 0},
-       {"F5", TRUE, 0},
-       {"F6", TRUE, 0},
-       {"F7", TRUE, 0},
-       {"F8", TRUE, 0},
-       {"F9", TRUE, 0},
-       {"FA", TRUE, 0},
-       {"FB", TRUE, 0},
-       {"FC", TRUE, 0},
-       {"FD", TRUE, 0},
-       {"FE", TRUE, 0},
-       {"FF", TRUE, 0},
-       {"FG", TRUE, 0},
-       {"FH", TRUE, 0},
-       {"FI", TRUE, 0},
-       {"FJ", TRUE, 0},
-       {"FK", TRUE, 0},
-       {"FL", TRUE, 0},
-       {"FM", TRUE, 0},
-       {"FN", TRUE, 0},
-       {"FO", TRUE, 0},
-       {"FP", TRUE, 0},
-       {"FQ", TRUE, 0},
-       {"FR", TRUE, 0},
-       {"FS", TRUE, 0},
-       {"FT", TRUE, 0},
-       {"FU", TRUE, 0},
-       {"FV", TRUE, 0},
-       {"FW", TRUE, 0},
-       {"FX", TRUE, 0},
-       {"FY", TRUE, 0},
-       {"FZ", TRUE, 0},
-
-       {"Fa", TRUE, 0},
-       {"Fb", TRUE, 0},
-       {"Fc", TRUE, 0},
-       {"Fd", TRUE, 0},
-       {"Fe", TRUE, 0},
-       {"Ff", TRUE, 0},
-       {"Fg", TRUE, 0},
-       {"Fh", TRUE, 0},
-       {"Fi", TRUE, 0},
-       {"Fj", TRUE, 0},
-       {"Fk", TRUE, 0},
-       {"Fl", TRUE, 0},
-       {"Fm", TRUE, 0},
-       {"Fn", TRUE, 0},
-       {"Fo", TRUE, 0},
-       {"Fp", TRUE, 0},
-       {"Fq", TRUE, 0},
-       {"Fr", TRUE, 0},
-
-       {"ff", FALSE, 0},
-       {"fs", FALSE, 0},
-
-       {"hd", FALSE, 0},
-       {"ho", FALSE, 0},
-       {"hu", FALSE, 0},
-
-       {"i1", FALSE, 0},
-       {"i3", FALSE, 0},
-
-       {"ic", FALSE, 0},
-       {"IC", FALSE, 0},
-       {"if", FALSE, 0},
-       {"im", FALSE, 0},
-       {"ip", FALSE, 0},
-       {"iP", FALSE, 0},
-       {"is", FALSE, 0},
-
-       {"K1", TRUE, 0},
-       {"K2", TRUE, 0},
-       {"K3", TRUE, 0},
-       {"K4", TRUE, 0},
-       {"K5", TRUE, 0},
-
-       {"k0", TRUE, 0},
-       {"k1", TRUE, 0},
-       {"k2", TRUE, 0},
-       {"k3", TRUE, 0},
-       {"k4", TRUE, 0},
-       {"k5", TRUE, 0},
-       {"k6", TRUE, 0},
-       {"k7", TRUE, 0},
-       {"k8", TRUE, 0},
-       {"k9", TRUE, 0},
-       {"k;", TRUE, 0},
-       {"ka", TRUE, 0},
-       {"kA", TRUE, 0},
-       {"kb", TRUE, 0},
-       {"kB", TRUE, 0},
-       {"kC", TRUE, 0},
-       {"kd", TRUE, 0},
-       {"kD", TRUE, 0},
-       {"ke", TRUE, 0},
-       {"kE", TRUE, 0},
-       {"kF", TRUE, 0},
-       {"kh", TRUE, 0},
-       {"kH", TRUE, 0},
-       {"kI", TRUE, 0},
-       {"kl", TRUE, 0},
-       {"kL", TRUE, 0},
-       {"kM", TRUE, 0},
-       {"kN", TRUE, 0},
-       {"kP", TRUE, 0},
-       {"kr", TRUE, 0},
-       {"kR", TRUE, 0},
-       {"ks", TRUE, 0},
-       {"kS", TRUE, 0},
-       {"kt", TRUE, 0},
-       {"kT", TRUE, 0},
-       {"ku", TRUE, 0},
-
-       {"l0", FALSE, 0},
-       {"l1", FALSE, 0},
-       {"l2", FALSE, 0},
-       {"l3", FALSE, 0},
-       {"l4", FALSE, 0},
-       {"l5", FALSE, 0},
-       {"l6", FALSE, 0},
-       {"l7", FALSE, 0},
-       {"l8", FALSE, 0},
-       {"l9", FALSE, 0},
-
-       {"la", FALSE, 0},
-       {"le", FALSE, 0},
-       {"LE", FALSE, 0},
-       {"LF", FALSE, 0},
-       {"ll", FALSE, 0},
-       {"LO", FALSE, 0},
-
-       {"mb", FALSE, 0},
-       {"MC", FALSE, 0},
-       {"md", FALSE, 0},
-       {"me", FALSE, 0},
-       {"mh", FALSE, 0},
-       {"mk", FALSE, 0},
-       {"ml", FALSE, 0},
-       {"ML", FALSE, 0},
-       {"mm", FALSE, 0},
-       {"mo", FALSE, 0},
-       {"mp", FALSE, 0},
-       {"mr", FALSE, 0},
-       {"MR", FALSE, 0},
-       {"mu", FALSE, 0},
-
-       {"nd", FALSE, 0},
-       {"nl", FALSE, 0},
-       {"nw", FALSE, 0},
-
-       {"pc", FALSE, 0},
-       {"pf", FALSE, 0},
-       {"pk", FALSE, 0},
-       {"pl", FALSE, 0},
-       {"pn", FALSE, 0},
-       {"po", FALSE, 0},
-       {"pO", FALSE, 0},
-       {"ps", FALSE, 0},
-       {"px", FALSE, 0},
-
-       {"r1", FALSE, 0},
-       {"r2", FALSE, 0},
-       {"r3", FALSE, 0},
-
-       {"RA", FALSE, 0},
-       {"rc", FALSE, 0},
-       {"rf", FALSE, 0},
-       {"RF", FALSE, 0},
-       {"RI", FALSE, 0},
-       {"rp", FALSE, 0},
-       {"rP", FALSE, 0},
-       {"rs", FALSE, 0},
-       {"RX", FALSE, 0},
-
-       {"s0", FALSE, 0},
-       {"s1", FALSE, 0},
-       {"s2", FALSE, 0},
-       {"s3", FALSE, 0},
-
-       {"sa", FALSE, 0},
-       {"SA", FALSE, 0},
-       {"sc", FALSE, 0},
-       {"se", FALSE, 0},
-       {"sf", FALSE, 0},
-       {"SF", FALSE, 0},
-       /* {"so", 0}, standout is always the same as another attribute. */
-       {"sr", FALSE, 0},
-       {"SR", FALSE, 0},
-       {"st", FALSE, 0},
-       {"SX", FALSE, 0},
-
-       {"ta", FALSE, 0},
-       /* {"te", 0}, terminal end-use is "logical". */
-       /* {"ti", 0}, terminal init is "logical". */
-       {"ts", FALSE, 0},
-
-       {"uc", FALSE, 0},
-       {"ue", FALSE, 0},
-       {"up", FALSE, 0},
-       {"UP", FALSE, 0},
-       {"us", FALSE, 0},
-
-       {"vb", FALSE, 0},
-       /* {"ve", FALSE, 0}, */
-       {"vi", FALSE, 0},
-       /* {"vs", FALSE, 0}, */
-
-       {"wi", FALSE, 0},
-
-       {"XF", FALSE, 0},
-       {"XN", FALSE, 0},
-
-
-       {"", FALSE, 0}
-};
-
 /* From some really old XTerm docs we had at the office, and an updated
  * version at Moy, Gildea, and Dickey. */
 struct _vte_capability_string _vte_xterm_capability_strings[] = {
@@ -595,37 +274,3 @@ struct _vte_capability_string _vte_xterm_capability_strings[] = {
 
        {NULL, NULL, 0},
 };
-
-#if 0
-/**
- * vte_capability_init:
- *
- * Initializes the vte_terminal_capability_strings and
- * vte_xterm_capability_strings structures used by the terminal.  Can
- * be called multiple times without ill effect.
- *
- * Returns: void
- */
-
-void
-_vte_capability_init(void)
-{
-       unsigned int i;
-       for (i = 0; _vte_terminal_capability_strings[i].capability[0]; i++) {
-               const char *tmp;
-               GQuark quark;
-               tmp = _vte_terminal_capability_strings[i].capability;
-               quark = g_quark_from_static_string(tmp);
-               _vte_terminal_capability_strings[i].quark = quark;
-       }
-       for (i = 0; i < G_N_ELEMENTS(_vte_xterm_capability_strings); i++) {
-               const char *tmp;
-               GQuark quark;
-               tmp = _vte_xterm_capability_strings[i].value;
-               if (tmp != NULL) {
-                       quark = g_quark_from_static_string(tmp);
-                       _vte_xterm_capability_strings[i].quark = quark;
-               }
-       }
-}
-#endif
diff --git a/src/caps.h b/src/caps.h
index a043c58..f28f3bd 100644
--- a/src/caps.h
+++ b/src/caps.h
@@ -35,22 +35,12 @@ G_BEGIN_DECLS
 #define _VTE_CAP_SS2 _VTE_CAP_ESC "N"  /* Single-shift to G2 */
 #define _VTE_CAP_SS3 _VTE_CAP_ESC "O"  /* Single-shift to G3 */
 
-/* A NULL-terminated list of capability strings which have string values,
- * which means they're either key sequences or commands. */
-struct _vte_capability_quark {
-       const char capability[4];
-       gboolean key;
-       GQuark quark;
-};
 struct _vte_capability_string {
        const char *code;
        const char *value;
        GQuark quark;
 };
 
-/* The known capability strings in termcap entries, terminated by NULLs. */
-extern struct _vte_capability_quark _vte_terminal_capability_strings[];
-
 /* The xterm-specific terminal control strings, terminated by NULLs. */
 extern struct _vte_capability_string _vte_xterm_capability_strings[];
 
diff --git a/src/interpret.c b/src/interpret.c
index 4165637..7d79037 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -33,14 +33,13 @@
 #include "debug.h"
 #include "iso2022.h"
 #include "matcher.h"
-#include "vtetc.h"
+#include "vteti.h"
 
 int
 main(int argc, char **argv)
 {
-       char *terminal = NULL;
        struct _vte_matcher *matcher = NULL;
-       struct _vte_termcap *termcap = NULL;
+       struct _vte_terminfo *terminfo = NULL;
        GArray *array;
        unsigned int i, j;
        int l;
@@ -55,7 +54,7 @@ main(int argc, char **argv)
        _vte_debug_init();
 
        if (argc < 2) {
-               g_print("usage: %s terminal [file]\n", argv[0]);
+               g_print("usage: %s TERM [file]\n", argv[0]);
                return 1;
        }
 
@@ -71,16 +70,15 @@ main(int argc, char **argv)
        }
 
        g_type_init();
-       terminal = argv[1];
-       termcap = _vte_termcap_new(terminal);
-        if (termcap == NULL) {
-                g_printerr ("No termcap entry for '%s'\n", terminal);
+       terminfo = _vte_terminfo_new(argv[1]);
+        if (terminfo == NULL) {
+                g_printerr ("No terminfo entry for '%s'\n", argv[1]);
                 return 1;
         }
 
        array = g_array_new(FALSE, FALSE, sizeof(gunichar));
 
-       matcher = _vte_matcher_new(terminal, termcap);
+       matcher = _vte_matcher_new(terminfo);
 
        subst = _vte_iso2022_state_new(NULL, VTE_ISO2022_DEFAULT_UTF8_AMBIGUOUS_WIDTH, NULL, NULL);
 
@@ -166,7 +164,7 @@ main(int argc, char **argv)
 
        _vte_iso2022_state_free(subst);
        g_array_free(array, TRUE);
-       _vte_termcap_free(termcap);
+       _vte_terminfo_unref(terminfo);
        _vte_matcher_free(matcher);
        return 0;
 }
diff --git a/src/iso2022.c b/src/iso2022.c
index f493496..0989082 100644
--- a/src/iso2022.c
+++ b/src/iso2022.c
@@ -35,7 +35,7 @@
 #endif
 #include <glib/gi18n-lib.h>
 
-#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
 
 /* Maps which jive with XTerm's ESC ()*+ ? sequences, RFC 1468.  Add the
  * PC437 map because despite knowing that XTerm doesn't support it, certain
diff --git a/src/keymap.c b/src/keymap.c
index c61d7d8..0e0fa26 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -27,26 +27,6 @@
 #include "caps.h"
 #include "debug.h"
 #include "keymap.h"
-#include "vtetc.h"
-
-#if defined(HAVE_NCURSES_H) && defined(HAVE_TERM_H)
-#include <ncurses.h>
-#include <term.h>
-#define VTE_TERMCAP_NAME "ncurses"
-#elif defined(HAVE_NCURSES_CURSES_H) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/curses.h>
-#include <ncurses/term.h>
-#define VTE_TERMCAP_NAME "ncurses"
-#elif defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
-#include <curses.h>
-#include <term.h>
-#define VTE_TERMCAP_NAME "curses"
-#elif defined(HAVE_TERMCAP_H)
-#include <termcap.h>
-#define VTE_TERMCAP_NAME "termcap"
-#else
-#error No termcap??
-#endif
 
 #ifdef VTE_DEBUG
 static void
@@ -152,7 +132,7 @@ struct _vte_keymap_entry {
        GdkModifierType mod_mask;
        const char normal[8];
        gssize normal_length;
-       const char special[4];
+       const char cap[8];
 };
 
 #define X_NULL ""
@@ -181,7 +161,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_space[] = {
 static const struct _vte_keymap_entry _vte_keymap_GDK_Tab[] = {
        /* Shift+Tab = Back-Tab */
        {cursor_all, keypad_all, fkey_all,
-        GDK_SHIFT_MASK, X_NULL, 0, "kB"},
+        GDK_SHIFT_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_BTAB},
        {cursor_all, keypad_all, fkey_all,
         GDK_SHIFT_MASK, _VTE_CAP_CSI "Z", -1, X_NULL},
        /* Alt+Tab = Esc+Tab */
@@ -189,7 +169,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Tab[] = {
         VTE_META_MASK, _VTE_CAP_ESC "\t", -1, X_NULL},
        /* Regular tab. */
        {cursor_all, keypad_all, fkey_all,
-        0, X_NULL, 0, "ta"},
+        0, X_NULL, 0, VTE_TERMINFO_CAP_TAB /* not a KEY_ cap ‽ */},
        {cursor_all, keypad_all, fkey_all, 0, "\t", 1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
@@ -210,7 +190,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Escape[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_Insert[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kI"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_IC},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "Q", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "2z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_notsunhp, 0, _VTE_CAP_CSI "2~", -1, X_NULL},
@@ -218,7 +198,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Insert[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_ISO_Left_Tab[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kB"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_BTAB},
        {cursor_all, keypad_all, fkey_all, 0, _VTE_CAP_CSI "Z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
@@ -276,26 +256,26 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Minus[] = {
 /* Home and End are strange cases because their sequences vary wildly from
  * system to system, or mine's just broken.  But anyway. */
 static const struct _vte_keymap_entry _vte_keymap_GDK_Home[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kh"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_HOME},
        {cursor_all, keypad_all, fkey_vt220, 0, _VTE_CAP_CSI "1~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "h", -1, X_NULL},
-       {cursor_all, keypad_all, fkey_nothpvt, 0, X_NULL, 0, "kh"},
+       {cursor_all, keypad_all, fkey_nothpvt, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_HOME},
        {cursor_default, keypad_all, fkey_default, 0, _VTE_CAP_CSI "H", -1, X_NULL},
        {cursor_app, keypad_all, fkey_default, 0, _VTE_CAP_SS3 "H", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_End[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "@7"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_END},
        {cursor_all, keypad_all, fkey_vt220, 0, _VTE_CAP_CSI "4~", -1, X_NULL},
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "@7"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_END},
        {cursor_default, keypad_all, fkey_default, 0, _VTE_CAP_CSI "F", -1, X_NULL},
        {cursor_app, keypad_all, fkey_default, 0, _VTE_CAP_SS3 "F", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_Page_Up[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kP"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_PPAGE},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "T", -1, X_NULL},
        {cursor_all, keypad_all, fkey_notsunhp, 0, _VTE_CAP_CSI "5~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "5z", -1, X_NULL},
@@ -303,7 +283,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Page_Up[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_Page_Down[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kN"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_NPAGE},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "S", -1, X_NULL},
        {cursor_all, keypad_all, fkey_notsunhp, 0, _VTE_CAP_CSI "6~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "6z", -1, X_NULL},
@@ -312,7 +292,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Page_Down[] = {
 
 /* Keys affected by the cursor key mode. */
 static const struct _vte_keymap_entry _vte_keymap_GDK_Up[] = {
-       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, "ku"},
+       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_UP},
        {cursor_default, keypad_all, fkey_nothp, 0, _VTE_CAP_CSI "A", -1, X_NULL},
        {cursor_default, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "A", -1, X_NULL},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "A", -1, X_NULL},
@@ -320,7 +300,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Up[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_Down[] = {
-       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, "kd"},
+       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_DOWN},
        {cursor_default, keypad_all, fkey_nothp, 0, _VTE_CAP_CSI "B", -1, X_NULL},
        {cursor_default, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "B", -1, X_NULL},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "B", -1, X_NULL},
@@ -328,7 +308,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Down[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_Right[] = {
-       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, "kr"},
+       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_RIGHT},
        {cursor_default, keypad_all, fkey_nothp, 0, _VTE_CAP_CSI "C", -1, X_NULL},
        {cursor_default, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "C", -1, X_NULL},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "C", -1, X_NULL},
@@ -336,7 +316,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_Right[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_Left[] = {
-       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, "kl"},
+       {cursor_default, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_LEFT},
        {cursor_default, keypad_all, fkey_nothp, 0, _VTE_CAP_CSI "D", -1, X_NULL},
        {cursor_default, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "D", -1, X_NULL},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "D", -1, X_NULL},
@@ -357,7 +337,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Tab[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Enter[] = {
-       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "@8"},
+       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_ENTER},
        {cursor_all, keypad_app, fkey_all, VTE_NUMLOCK_MASK | GDK_CONTROL_MASK, "\n", 1, X_NULL},
        {cursor_all, keypad_app, fkey_all, VTE_NUMLOCK_MASK, "\r", 1, X_NULL},
        {cursor_all, keypad_app, fkey_all, 0, _VTE_CAP_SS3 "M", -1, X_NULL},
@@ -367,25 +347,25 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Enter[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_F1[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "k1"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F1},
        {cursor_all, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "P", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_F2[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "k2"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F2},
        {cursor_all, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "Q", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_F3[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "k3"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F3},
        {cursor_all, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "R", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_F4[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "k4"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F4},
        {cursor_all, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "S", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
@@ -501,7 +481,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Insert[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_End[] = {
-       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K4"},
+       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_C1},
        {cursor_all, keypad_default, fkey_notvt220,
         0, _VTE_CAP_CSI "4~", -1, X_NULL},
        {cursor_all, keypad_default, fkey_vt220, 0, "1", 1, X_NULL},
@@ -513,7 +493,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_End[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Down[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kd"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_DOWN},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "B", -1, X_NULL},
        {cursor_default, keypad_all, fkey_notvt220,
         0, _VTE_CAP_CSI "B", -1, X_NULL},
@@ -523,7 +503,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Down[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Page_Down[] = {
-       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K5"},
+       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_C3},
        {cursor_all, keypad_default, fkey_notsunvt,
         0, _VTE_CAP_CSI "6~", -1, X_NULL},
        {cursor_all, keypad_default, fkey_sun, 0, _VTE_CAP_CSI "6z", -1, X_NULL},
@@ -534,7 +514,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Page_Down[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Left[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kl"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_LEFT},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "D", -1, X_NULL},
        {cursor_default, keypad_all, fkey_notvt220,
         0, _VTE_CAP_CSI "D", -1, X_NULL},
@@ -544,7 +524,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Left[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Begin[] = {
-       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K2"},
+       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_B2 /* FIXMEchpe: not KEY_A1 
!? */},
        {cursor_app, keypad_all, fkey_notvt220, 0, _VTE_CAP_SS3 "E", -1, X_NULL},
        {cursor_default, keypad_all, fkey_notvt220, 0, _VTE_CAP_CSI "E", -1, X_NULL},
        {cursor_all, keypad_default, fkey_vt220, 0, "5", 1, X_NULL},
@@ -553,7 +533,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Begin[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Right[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "kr"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_RIGHT},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "C", -1, X_NULL},
        {cursor_default, keypad_all, fkey_notvt220,
         0, _VTE_CAP_CSI "C", -1, X_NULL},
@@ -563,7 +543,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Right[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Home[] = {
-       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K1"},
+       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_A1},
        {cursor_all, keypad_default, fkey_notvt220,
         0, _VTE_CAP_CSI "1~", -1, X_NULL},
        {cursor_all, keypad_default, fkey_vt220, 0, "7", 1, X_NULL},
@@ -575,7 +555,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Home[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Up[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "ku"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_UP},
        {cursor_app, keypad_all, fkey_all, 0, _VTE_CAP_SS3 "A", -1, X_NULL},
        {cursor_default, keypad_all, fkey_notvt220,
         0, _VTE_CAP_CSI "A", -1, X_NULL},
@@ -585,7 +565,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Up[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Page_Up[] = {
-       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K3"},
+       {cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_A3},
        {cursor_all, keypad_default, fkey_notvt220,
         0, _VTE_CAP_CSI "5~", -1, X_NULL},
        {cursor_all, keypad_default, fkey_vt220, 0, "9", 1, X_NULL},
@@ -597,9 +577,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Page_Up[] = {
 
 /* Keys affected by the function key mode. */
 static const struct _vte_keymap_entry _vte_keymap_GDK_F1[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k1"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F3"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k1"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F1},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F13},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F1},
        {cursor_all, keypad_all, fkey_default, GDK_CONTROL_MASK, _VTE_CAP_CSI "P", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, GDK_SHIFT_MASK, _VTE_CAP_CSI "P", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, VTE_META_MASK, _VTE_CAP_CSI "P", -1, X_NULL},
@@ -614,9 +594,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F1[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F2[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k2"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F4"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k2"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F2},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F14},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F2},
        {cursor_all, keypad_all, fkey_default, GDK_CONTROL_MASK, _VTE_CAP_CSI "Q", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, GDK_SHIFT_MASK, _VTE_CAP_CSI "Q", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, VTE_META_MASK, _VTE_CAP_CSI "Q", -1, X_NULL},
@@ -631,9 +611,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F2[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F3[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k3"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F5"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k3"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F3},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F15},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F3},
        {cursor_all, keypad_all, fkey_default, GDK_CONTROL_MASK, _VTE_CAP_CSI "R", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, GDK_SHIFT_MASK, _VTE_CAP_CSI "R", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, VTE_META_MASK, _VTE_CAP_CSI "R", -1, X_NULL},
@@ -648,9 +628,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F3[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F4[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k4"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F6"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k4"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F4},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F16},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F4},
        {cursor_all, keypad_all, fkey_default, GDK_CONTROL_MASK, _VTE_CAP_CSI "S", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, GDK_SHIFT_MASK, _VTE_CAP_CSI "S", -1, X_NULL},
        {cursor_all, keypad_all, fkey_default, VTE_META_MASK, _VTE_CAP_CSI "S", -1, X_NULL},
@@ -665,9 +645,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F4[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F5[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k5"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F7"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k5"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F5},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F17},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F5},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "15~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "228z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "t", -1, X_NULL},
@@ -679,9 +659,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F5[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F6[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k6"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F8"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k6"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F6},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F18},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F6},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "17~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "229z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "u", -1, X_NULL},
@@ -693,9 +673,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F6[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F7[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k7"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "F9"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k7"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F7},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F19},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F7},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "18~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "230z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "v", -1, X_NULL},
@@ -707,9 +687,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F7[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F8[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k8"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "FA"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k8"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F8},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F20},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F8},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "19~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "231z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_ESC "w", -1, X_NULL},
@@ -721,9 +701,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F8[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F9[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k9"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "FB"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k9"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F9},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F21},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F9},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "20~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "232z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_CSI "20~", -1, X_NULL},
@@ -735,9 +715,9 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F9[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F10[] = {
-       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, "k;"},
-       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, "FC"},
-       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, "k;"},
+       {cursor_all, keypad_all, fkey_notvt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F10},
+       {cursor_all, keypad_all, fkey_vt220, GDK_CONTROL_MASK, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F22},
+       {cursor_all, keypad_all, fkey_vt220, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F10},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "21~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "233z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_CSI "21~", -1, X_NULL},
@@ -749,7 +729,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F10[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F11[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F1"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F11},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "23~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "192z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_CSI "23~", -1, X_NULL},
@@ -759,7 +739,7 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F11[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F12[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F2"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F12},
        {cursor_all, keypad_all, fkey_default, 0, _VTE_CAP_CSI "24~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "193z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_hp, 0, _VTE_CAP_CSI "24~", -1, X_NULL},
@@ -769,133 +749,133 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_F12[] = {
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F13[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F3"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F13},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "25~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "194z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F14[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F4"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F14},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "26~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "195z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F15[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F5"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F15},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "28~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "196z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F16[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F6"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F16},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "29~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "197z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F17[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F7"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F17},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "31~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "198z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F18[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F8"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F18},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "32~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "199z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F19[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "F9"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F19},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "33~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "200z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F20[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FA"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F20},
        {cursor_all, keypad_all, fkey_notsun, 0, _VTE_CAP_CSI "34~", -1, X_NULL},
        {cursor_all, keypad_all, fkey_sun, 0, _VTE_CAP_CSI "201z", -1, X_NULL},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F21[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FB"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F21},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F22[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FC"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F22},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F23[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FD"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F23},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F24[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FE"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F24},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F25[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FF"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F25},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F26[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FG"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F26},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F27[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FH"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F27},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F28[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FI"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F28},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F29[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FJ"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F29},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F30[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FK"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F30},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F31[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FL"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F31},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F32[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FM"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F32},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F33[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FN"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F33},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F34[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FO"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F34},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
 static const struct _vte_keymap_entry _vte_keymap_GDK_F35[] = {
-       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, "FP"},
+       {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, VTE_TERMINFO_CAP_KEY_F35},
        {cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
 
@@ -1014,25 +994,21 @@ _vte_keymap_map(guint keyval,
                gboolean vt220_mode,
                gboolean app_cursor_keys,
                gboolean app_keypad_keys,
-               struct _vte_termcap *termcap,
-               const char *terminal,
+               struct _vte_terminfo *terminfo,
                char **normal,
                gssize *normal_length,
-               const char **special)
+               const char **terminfo_cap)
 {
        gsize i;
        const struct _vte_keymap_entry *entries;
        enum _vte_cursor_mode cursor_mode;
        enum _vte_keypad_mode keypad_mode;
        enum _vte_fkey_mode fkey_mode;
-       char *cap, *tmp;
-       const char *termcap_special = NULL;
-       char ncurses_buffer[4096];
-       char ncurses_area[512];
+       const char *cap = NULL;
 
        g_return_if_fail(normal != NULL);
        g_return_if_fail(normal_length != NULL);
-       g_return_if_fail(special != NULL);
+       g_return_if_fail(terminfo_cap != NULL);
 
        _VTE_DEBUG_IF(VTE_DEBUG_KEYBOARD) 
                _vte_keysym_print(keyval, modifiers,
@@ -1043,8 +1019,8 @@ _vte_keymap_map(guint keyval,
 
        /* Start from scratch. */
        *normal = NULL;
-       *special = NULL;
        *normal_length = 0;
+       *terminfo_cap = NULL;
 
        /* Search for the list for this key. */
        entries = NULL;
@@ -1055,9 +1031,9 @@ _vte_keymap_map(guint keyval,
                /* Check for NULL strings with non-zero length, and
                 * vice-versa. */
                entries = _vte_keymap[i].entries;
-               for (j = 0; entries[j].normal_length || entries[j].special[0]; j++) {
+               for (j = 0; entries[j].normal_length || entries[j].cap[0]; j++) {
                        if (entries[j].normal_length) {
-                               g_assert(!entries[j].special[0]);
+                               g_assert(!entries[j].cap[0]);
                        } else {
                                g_assert(!entries[j].normal[0]);
                        }
@@ -1065,7 +1041,7 @@ _vte_keymap_map(guint keyval,
                /* Check for coverage. This check is not exhaustive. */
                fkey_mode = 0;
                mods = GDK_SHIFT_MASK | GDK_CONTROL_MASK | VTE_META_MASK | VTE_NUMLOCK_MASK;
-               for (j = 0; entries[j].normal_length || entries[j].special[0]; j++) {
+               for (j = 0; entries[j].normal_length || entries[j].cap[0]; j++) {
                        if (entries[j].fkey_mode != fkey_all) {
                                fkey_mode |= entries[j].fkey_mode;
                        }
@@ -1120,7 +1096,7 @@ _vte_keymap_map(guint keyval,
        modifiers &= (GDK_SHIFT_MASK | GDK_CONTROL_MASK | VTE_META_MASK | VTE_NUMLOCK_MASK);
 
        /* Search for the conditions. */
-       for (i = 0; entries[i].normal_length || entries[i].special[0]; i++)
+       for (i = 0; entries[i].normal_length || entries[i].cap[0]; i++)
        if ((entries[i].cursor_mode & cursor_mode) &&
            (entries[i].keypad_mode & keypad_mode) &&
            (entries[i].fkey_mode & fkey_mode))
@@ -1143,83 +1119,22 @@ _vte_keymap_map(guint keyval,
                                                          cursor_mode & cursor_app,
                                                          normal,
                                                          normal_length);
-                       _VTE_DEBUG_IF(VTE_DEBUG_KEYBOARD) {
-                               int j;
-                               g_printerr(" to '");
-                               for (j = 0; j < *normal_length; j++) {
-                                       if (((*normal)[j] < 32) ||
-                                           ((*normal)[j] >= 127)) {
-                                               g_printerr("<0x%02x>",
-                                                       (*normal)[j]);
-                                       } else {
-                                               g_printerr("%c",
-                                                       (*normal)[j]);
-                                       }
-                               }
-                               g_printerr("'.\n");
-                       }
+                       _vte_debug_print(VTE_DEBUG_KEYBOARD,
+                                         " to '%s'.\n",
+                                         _vte_terminfo_sequence_to_string(*normal));
                        return;
                } else {
-                       termcap_special = entries[i].special;
-                       cap = _vte_termcap_find_string(termcap,
-                                                      terminal,
-                                                      entries[i].special);
-                       if (cap != NULL) {
-                               *special = NULL;
-                               if (strlen(cap) > 0) {
-                                       /* Save the special string. */
-                                       *special = entries[i].special;
-                                       _vte_debug_print(VTE_DEBUG_KEYBOARD,
-                                                       " to \"%s\"", *special);
-                               }
-                               g_free(cap);
-                               if (*special != NULL) {
-                                       /* Return the special string. */
-                                       _vte_debug_print(VTE_DEBUG_KEYBOARD,
-                                                       ", returning.\n");
-                                       return;
-                               }
-                       }
-               }
-       }
-       if (termcap_special != NULL) {
-               tmp = g_strdup(terminal);
-               cap = NULL;
-               if (tgetent(ncurses_buffer, tmp) == 1) {
-                       cap = ncurses_area;
-                       tmp = g_strdup(termcap_special);
-                       cap = tgetstr(tmp, &cap);
-               }
-               if ((cap == NULL) && (strstr(terminal, "xterm") != NULL)) {
-                       /* try, try again */
-                       if (tgetent(ncurses_buffer, "xterm-xfree86") == 1) {
-                               cap = ncurses_area;
-                               tmp = g_strdup(termcap_special);
-                               cap = tgetstr(tmp, &cap);
-                       }
-               }
-               g_free(tmp);
-               if ((cap != NULL) && (*cap != '\0')) {
-                       *normal_length = strlen(cap);
-                       *normal = g_strdup(cap);
-#ifdef VTE_DEBUG
-                       if (_vte_debug_on(VTE_DEBUG_KEYBOARD)) {
-                               int j;
-                               g_printerr(" via " VTE_TERMCAP_NAME " to '");
-                               for (j = 0; j < *normal_length; j++) {
-                                       if (((*normal)[j] < 32) ||
-                                           ((*normal)[j] >= 127)) {
-                                               g_printerr("<0x%02x>",
-                                                       (*normal)[j]);
-                                       } else {
-                                               g_printerr("%c",
-                                                       (*normal)[j]);
-                                       }
-                               }
-                               g_printerr("', returning.\n");
+                        cap = _vte_terminfo_get_string_by_cap(terminfo, entries[i].cap, FALSE);
+                        if (cap != NULL && cap[0] != 0) {
+                                /* Save the special string. */
+                                *terminfo_cap = entries[i].cap;
+
+                                _vte_debug_print(VTE_DEBUG_KEYBOARD,
+                                                 " via terminfo cap '%s' to '%s' , returning.\n",
+                                                 entries[i].cap,
+                                                 _vte_terminfo_sequence_to_string(cap));
+                                return;
                        }
-#endif
-                       return;
                }
        }
 
diff --git a/src/keymap.h b/src/keymap.h
index 0f19aef..bd57f98 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -23,7 +23,8 @@
 
 #include <glib.h>
 #include <gdk/gdk.h>
-#include "vtetc.h"
+
+#include "vteti.h"
 
 G_BEGIN_DECLS
 
@@ -40,8 +41,7 @@ void _vte_keymap_map(guint keyval,
                     gboolean vt220_mode,
                     gboolean app_cursor_keys,
                     gboolean app_keypad_keys,
-                    struct _vte_termcap *termcap,
-                    const char *term,
+                    struct _vte_terminfo *terminfo,
                     char **normal,
                     gssize *normal_length,
                     const char **special);
diff --git a/src/matcher.c b/src/matcher.c
index fddae0a..a9f8b2b 100644
--- a/src/matcher.c
+++ b/src/matcher.c
@@ -33,8 +33,11 @@ struct _vte_matcher {
        GValueArray *free_params;
 };
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 static GStaticMutex _vte_matcher_mutex = G_STATIC_MUTEX_INIT;
 static GCache *_vte_matcher_cache = NULL;
+G_GNUC_END_IGNORE_DEPRECATIONS;
+
 static struct _vte_matcher_impl dummy_vte_matcher_trie = {
        &_vte_matcher_trie
 };
@@ -42,6 +45,12 @@ static struct _vte_matcher_impl dummy_vte_matcher_table = {
        &_vte_matcher_table
 };
 
+#ifdef VTE_COMPILATION
+#include "vte-private.h"
+#else
+static gboolean _vte_terminal_can_handle_sequence(const char *name) { return TRUE; }
+#endif
+
 /* Add a string to the matcher. */
 static void
 _vte_matcher_add(const struct _vte_matcher *matcher,
@@ -51,54 +60,72 @@ _vte_matcher_add(const struct _vte_matcher *matcher,
        matcher->impl->klass->add(matcher->impl, pattern, length, result, quark);
 }
 
+static void
+_vte_matcher_add_one(struct _vte_terminfo *terminfo,
+                     const char *cap,
+                     const char *compat_cap,
+                     const char *value,
+                     gpointer user_data)
+{
+        struct _vte_matcher *matcher = user_data;
+
+        /* Skip key caps, which all start with 'k' in terminfo */
+        if (cap[0] == 'k')
+                return;
+
+        /* Skip anything that doesn't start with a control character. This catches
+         * ACS_CHARS and SGR, and the F0..F10 key labels (lf0..lf10).
+         */
+        if (value[0] >= 0x20 && value[0] < 0x7f){
+                _vte_debug_print(VTE_DEBUG_PARSE,
+                                 "Dropping caps %s with printable value '%s'\n",
+                                 cap, _vte_terminfo_sequence_to_string(value));
+                return;
+        }
+
+        /* We use the 2-character termcap code instead of the terminfo code
+         * if it exists, since that makes matching faster by using vteseq-2.
+         */
+        if (compat_cap[0] != 0)
+                cap = compat_cap;
+
+        /* If there is no handler for it, it'd be pointless to continue. */
+        if (!_vte_terminal_can_handle_sequence(cap)) {
+                _vte_debug_print(VTE_DEBUG_PARSE, "No handler for cap %s with value '%s', skipping\n",
+                                 cap, _vte_terminfo_sequence_to_string(value));
+                return;
+        }
+
+        _vte_debug_print(VTE_DEBUG_PARSE,
+                         "Adding caps %s with value '%s'\n", cap,
+                         _vte_terminfo_sequence_to_string(value));
+
+        _vte_matcher_add(matcher, value, strlen(value), cap, 0);
+}
+
 /* Loads all sequences into matcher */
 static void
-_vte_matcher_init(struct _vte_matcher *matcher, const char *emulation,
-                 struct _vte_termcap *termcap)
+_vte_matcher_init(struct _vte_matcher *matcher,
+                  struct _vte_terminfo *terminfo)
 {
        const char *code, *value;
-       gboolean found_cr = FALSE, found_lf = FALSE;
-       gssize stripped_length;
-       char *stripped;
        int i;
 
        _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_init()\n");
 
-       if (termcap != NULL) {
-               /* Load the known capability strings from the termcap
-                * structure into the table for recognition. */
-               for (i = 0;
-                               _vte_terminal_capability_strings[i].capability[0];
-                               i++) {
-                       if (_vte_terminal_capability_strings[i].key) {
-                               continue;
-                       }
-                       code = _vte_terminal_capability_strings[i].capability;
-                       stripped = _vte_termcap_find_string_length(termcap,
-                                       emulation,
-                                       code,
-                                       &stripped_length);
-                       if (stripped[0] != '\0') {
-                               _vte_matcher_add(matcher,
-                                               stripped, stripped_length,
-                                               code, 0);
-                               if (stripped[0] == '\r') {
-                                       found_cr = TRUE;
-                               } else
-                                       if (stripped[0] == '\n') {
-                                               if (strcmp(code, "sf") == 0 ||
-                                                               strcmp(code, "do") == 0) {
-                                                       found_lf = TRUE;
-                                               }
-                                       }
-                       }
-                       g_free(stripped);
-               }
-       }
+       if (terminfo != NULL) {
+                _vte_terminfo_foreach_string(terminfo, TRUE, _vte_matcher_add_one, matcher);
+
+                /* FIXME: we used to always add LF and CR to the matcher if they weren't in the
+                 * termcap. However this seems unlikely to happen since if the terminfo is so
+                 * broken it doesn't include CR and LF, everything else will be broken too.
+                 */
+        }
 
        /* Add emulator-specific sequences. */
-       if (strstr(emulation, "xterm") || strstr(emulation, "dtterm")) {
+        if (terminfo != NULL && _vte_terminfo_is_xterm_like(terminfo)) {
                /* Add all of the xterm-specific stuff. */
+
                for (i = 0;
                     _vte_xterm_capability_strings[i].value != NULL;
                     i++) {
@@ -109,14 +136,6 @@ _vte_matcher_init(struct _vte_matcher *matcher, const char *emulation,
                }
        }
 
-       /* Always define cr and lf. */
-       if (!found_cr) {
-               _vte_matcher_add(matcher, "\r", 1, "cr", 0);
-       }
-       if (!found_lf) {
-               _vte_matcher_add(matcher, "\n", 1, "sf", 0);
-       }
-
        _VTE_DEBUG_IF(VTE_DEBUG_TRIE) {
                g_printerr("Trie contents:\n");
                _vte_matcher_print(matcher);
@@ -128,7 +147,7 @@ _vte_matcher_init(struct _vte_matcher *matcher, const char *emulation,
 static gpointer
 _vte_matcher_create(gpointer key)
 {
-       char *emulation = key;
+        struct _vte_terminfo *terminfo = key;
        struct _vte_matcher *ret = NULL;
 
        _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_create()\n");
@@ -137,10 +156,10 @@ _vte_matcher_create(gpointer key)
        ret->match = NULL;
        ret->free_params = NULL;
 
-       if (strcmp(emulation, "xterm") == 0) {
-               ret->impl = &dummy_vte_matcher_table;
-       } else
-       if (strcmp(emulation, "dtterm") == 0) {
+        /* FIXMEchpe: this means the trie one is always unused? It also seems totally broken
+         * since when accidentally using it instead of table, all was messed up
+         */
+        if (_vte_terminfo_is_xterm_like(terminfo)) {
                ret->impl = &dummy_vte_matcher_table;
        }
 
@@ -164,31 +183,33 @@ _vte_matcher_destroy(gpointer value)
 
 /* Create and init matcher. */
 struct _vte_matcher *
-_vte_matcher_new(const char *emulation, struct _vte_termcap *termcap)
+_vte_matcher_new(struct _vte_terminfo *terminfo)
 {
        struct _vte_matcher *ret = NULL;
-       g_static_mutex_lock(&_vte_matcher_mutex);
 
-       if (emulation == NULL) {
-               emulation = "";
-       }
+        g_return_val_if_fail(terminfo != NULL, NULL);
+
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+       g_static_mutex_lock(&_vte_matcher_mutex);
 
        if (_vte_matcher_cache == NULL) {
-               _vte_matcher_cache = g_cache_new(_vte_matcher_create,
-                               _vte_matcher_destroy,
-                               (GCacheDupFunc) g_strdup, g_free,
-                               g_str_hash, g_direct_hash, g_str_equal);
+               _vte_matcher_cache = g_cache_new((GCacheNewFunc)_vte_matcher_create,
+                                                 (GCacheDestroyFunc)_vte_matcher_destroy,
+                                                 (GCacheDupFunc)_vte_terminfo_ref,
+                                                 (GCacheDestroyFunc)_vte_terminfo_unref,
+                                                 g_direct_hash, g_direct_hash, g_direct_equal);
        }
 
-       ret = g_cache_insert(_vte_matcher_cache, (gpointer) emulation);
+       ret = g_cache_insert(_vte_matcher_cache, terminfo);
 
        if (ret->match == NULL) {
                ret->impl = ret->impl->klass->create();
                ret->match = ret->impl->klass->match;
-               _vte_matcher_init(ret, emulation, termcap);
+               _vte_matcher_init(ret, terminfo);
        }
 
        g_static_mutex_unlock(&_vte_matcher_mutex);
+        G_GNUC_END_IGNORE_DEPRECATIONS;
        return ret;
 }
 
@@ -197,9 +218,11 @@ void
 _vte_matcher_free(struct _vte_matcher *matcher)
 {
        g_assert(_vte_matcher_cache != NULL);
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
        g_static_mutex_lock(&_vte_matcher_mutex);
        g_cache_remove(_vte_matcher_cache, matcher);
        g_static_mutex_unlock(&_vte_matcher_mutex);
+        G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 /* Check if a string matches a sequence the matcher knows about. */
@@ -245,4 +268,3 @@ _vte_matcher_free_params_array(struct _vte_matcher *matcher,
                params->n_values = 0;
        }
 }
-
diff --git a/src/matcher.h b/src/matcher.h
index 6e00073..3136fc8 100644
--- a/src/matcher.h
+++ b/src/matcher.h
@@ -23,7 +23,7 @@
 
 
 #include <glib-object.h>
-#include "vtetc.h"
+#include "vteti.h"
 
 G_BEGIN_DECLS
 
@@ -53,8 +53,7 @@ struct _vte_matcher_class{
 };
 
 /* Create and init matcher. */
-struct _vte_matcher *_vte_matcher_new(const char *emulation,
-                                     struct _vte_termcap *termcap);
+struct _vte_matcher *_vte_matcher_new(struct _vte_terminfo *terminfo);
 
 /* Free a matcher. */
 void _vte_matcher_free(struct _vte_matcher *matcher);
diff --git a/src/table.c b/src/table.c
index f1ea798..be2cd31 100644
--- a/src/table.c
+++ b/src/table.c
@@ -740,7 +740,7 @@ _vte_table_match(struct _vte_table *table,
                                        p += 2;
                                } else {
                                        _vte_debug_print (VTE_DEBUG_PARSE,
-                                                         "Invalid termcap sequence %s\n",
+                                                         "Invalid terminfo sequence %s\n",
                                                          original);
                                }
                        } /* else Literal. */
diff --git a/src/vte-private.h b/src/vte-private.h
index db3ae03..722fd4e 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -173,13 +173,12 @@ struct _VteTerminalPrivate {
         glong column_count;
 
        /* Emulation setup data. */
-       struct _vte_termcap *termcap;   /* termcap storage */
+       struct _vte_terminfo *terminfo; /* terminfo */
        struct _vte_matcher *matcher;   /* control sequence matcher */
        const char *emulation;          /* terminal type to emulate */
-       struct vte_terminal_flags {     /* boolean termcap flags */
+       struct vte_terminal_flags {     /* boolean terminfo flags */
                gboolean am;
                gboolean bw;
-               gboolean LP;
                gboolean ul;
                gboolean xn;
        } flags;
@@ -475,6 +474,7 @@ void _vte_terminal_handle_sequence(VteTerminal *terminal,
                                   const char *match_s,
                                   GQuark match,
                                   GValueArray *params);
+gboolean _vte_terminal_can_handle_sequence(const char *name);
 gboolean _vte_terminal_xy_to_grid(VteTerminal *terminal,
                                   long x,
                                   long y,
diff --git a/src/vte.c b/src/vte.c
index 8617b73..dfe80d4 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -55,7 +55,7 @@
 #include "vteint.h"
 #include "vtepty.h"
 #include "vtepty-private.h"
-#include "vtetc.h"
+#include "vteti.h"
 
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
@@ -80,7 +80,7 @@ typedef gunichar wint_t;
 #endif
 
 static void vte_terminal_set_visibility (VteTerminal *terminal, GdkVisibilityState state);
-static void vte_terminal_set_termcap(VteTerminal *terminal);
+static void vte_terminal_set_terminfo(VteTerminal *terminal);
 static void vte_terminal_paste(VteTerminal *terminal, GdkAtom board);
 static void vte_terminal_real_copy_clipboard(VteTerminal *terminal);
 static void vte_terminal_real_paste_clipboard(VteTerminal *terminal);
@@ -1083,10 +1083,9 @@ vte_terminal_set_default_tabstops(VteTerminal *terminal)
                g_hash_table_destroy(terminal->pvt->tabstops);
        }
        terminal->pvt->tabstops = g_hash_table_new(NULL, NULL);
-       if (terminal->pvt->termcap != NULL) {
-               width = _vte_termcap_find_numeric(terminal->pvt->termcap,
-                                                 terminal->pvt->emulation,
-                                                 "it");
+       if (terminal->pvt->terminfo != NULL) {
+               width = _vte_terminfo_get_numeric(terminal->pvt->terminfo,
+                                                  VTE_TERMINFO_VAR_INIT_TABS);
        }
        if (width == 0) {
                width = VTE_TAB_WIDTH;
@@ -4799,8 +4798,6 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
 {
        VteTerminal *terminal;
        GdkModifierType modifiers;
-       struct _vte_termcap *termcap;
-       const char *tterm;
        char *normal = NULL, *output;
        gssize normal_length = 0;
        int i;
@@ -4985,7 +4982,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                                suppress_meta_esc = FALSE;
                                break;
                        case VTE_ERASE_DELETE_SEQUENCE:
-                               special = "kD";
+                               special = VTE_TERMINFO_CAP_KEY_DC;
                                suppress_meta_esc = TRUE;
                                break;
                        case VTE_ERASE_TTY:
@@ -5043,10 +5040,11 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                        case VTE_ERASE_DELETE_SEQUENCE:
                        case VTE_ERASE_AUTO:
                        default:
-                               special = "kD";
+                               special = VTE_TERMINFO_CAP_KEY_DC;
                                break;
                        }
                        handled = TRUE;
+                        /* FIXMEchpe: why? this overrides the FALSE set above? */
                        suppress_meta_esc = TRUE;
                        break;
                case GDK_KEY_KP_Insert:
@@ -5152,7 +5150,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                }
                /* If the above switch statement didn't do the job, try mapping
                 * it to a literal or capability name. */
-               if (handled == FALSE && terminal->pvt->termcap != NULL) {
+               if (handled == FALSE && terminal->pvt->terminfo != NULL) {
                        _vte_keymap_map(keyval, modifiers,
                                        terminal->pvt->sun_fkey_mode,
                                        terminal->pvt->hp_fkey_mode,
@@ -5160,9 +5158,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                                        terminal->pvt->vt220_fkey_mode,
                                        terminal->pvt->cursor_mode == VTE_KEYMODE_APPLICATION,
                                        terminal->pvt->keypad_mode == VTE_KEYMODE_APPLICATION,
-                                       terminal->pvt->termcap,
-                                       terminal->pvt->emulation ?
-                                       terminal->pvt->emulation : vte_get_default_emulation(),
+                                       terminal->pvt->terminfo,
                                        &normal,
                                        &normal_length,
                                        &special);
@@ -5174,6 +5170,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                        }
                }
 
+                /* FIXMEchpe: Why only do this for ctrl and not meta/super too? */
                /* Shall we do this here or earlier?  See bug 375112 and bug 589557 */
                if (modifiers & GDK_CONTROL_MASK)
                        keyval = vte_translate_ctrlkey(event);
@@ -5234,13 +5231,9 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                        g_free(normal);
                } else
                /* If the key maps to characters, send them to the child. */
-               if (special != NULL && terminal->pvt->termcap != NULL) {
-                       termcap = terminal->pvt->termcap;
-                       tterm = terminal->pvt->emulation;
-                       normal = _vte_termcap_find_string_length(termcap,
-                                                                tterm,
-                                                                special,
-                                                                &normal_length);
+               if (special != NULL) {
+                        normal = g_strdup(_vte_terminfo_get_string_by_cap(terminal->pvt->terminfo, special, 
FALSE));
+                        normal_length = strlen(normal);
                        _vte_keymap_key_add_key_modifiers(keyval,
                                                          modifiers,
                                                          terminal->pvt->sun_fkey_mode,
@@ -5250,11 +5243,12 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                                                          terminal->pvt->cursor_mode == 
VTE_KEYMODE_APPLICATION,
                                                          &normal,
                                                          &normal_length);
+                        /* FIXMEchpe: wtf! */
                        output = g_strdup_printf(normal, 1);
                        vte_terminal_feed_child_using_modes(terminal,
                                                            output, -1);
+                        g_free(normal);
                        g_free(output);
-                       g_free(normal);
                }
                /* Keep the cursor on-screen. */
                if (!scrolled && !modifier &&
@@ -8020,7 +8014,7 @@ vte_terminal_set_vadjustment(VteTerminal *terminal,
  * @emulation: (allow-none): the name of a terminal description, or %NULL to use the default
  *
  * Sets what type of terminal the widget attempts to emulate by scanning for
- * control sequences defined in the system's termcap file.  Unless you
+ * control sequences defined in the system's terminfo file.  Unless you
  * are interested in this feature, always use "xterm".
  */
 void
@@ -8042,45 +8036,36 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
        terminal->pvt->emulation = g_intern_string(emulation);
        _vte_debug_print(VTE_DEBUG_MISC,
                        "Setting emulation to `%s'...\n", emulation);
-       /* Find and read the right termcap file. */
-       vte_terminal_set_termcap(terminal);
+       /* Find and read the right terminfo file. */
+       vte_terminal_set_terminfo(terminal);
 
        /* Create a table to hold the control sequences. */
        if (terminal->pvt->matcher != NULL) {
                _vte_matcher_free(terminal->pvt->matcher);
        }
-       terminal->pvt->matcher = _vte_matcher_new(emulation, terminal->pvt->termcap);
+       terminal->pvt->matcher = _vte_matcher_new(terminal->pvt->terminfo);
 
-       if (terminal->pvt->termcap != NULL) {
+       if (terminal->pvt->terminfo != NULL) {
                /* Read emulation flags. */
-               terminal->pvt->flags.am = _vte_termcap_find_boolean(terminal->pvt->termcap,
-                                                                   terminal->pvt->emulation,
-                                                                   "am");
-               terminal->pvt->flags.bw = _vte_termcap_find_boolean(terminal->pvt->termcap,
-                                                                   terminal->pvt->emulation,
-                                                                   "bw");
-               terminal->pvt->flags.LP = _vte_termcap_find_boolean(terminal->pvt->termcap,
-                                                                   terminal->pvt->emulation,
-                                                                   "LP");
-               terminal->pvt->flags.ul = _vte_termcap_find_boolean(terminal->pvt->termcap,
-                                                                   terminal->pvt->emulation,
-                                                                   "ul");
-               terminal->pvt->flags.xn = _vte_termcap_find_boolean(terminal->pvt->termcap,
-                                                                   terminal->pvt->emulation,
-                                                                   "xn");
+               terminal->pvt->flags.am = _vte_terminfo_get_boolean(terminal->pvt->terminfo,
+                                                                   VTE_TERMINFO_VAR_AUTO_RIGHT_MARGIN);
+               terminal->pvt->flags.bw = _vte_terminfo_get_boolean(terminal->pvt->terminfo,
+                                                                   VTE_TERMINFO_VAR_AUTO_LEFT_MARGIN);
+               terminal->pvt->flags.ul = _vte_terminfo_get_boolean(terminal->pvt->terminfo,
+                                                                   VTE_TERMINFO_VAR_TRANSPARENT_UNDERLINE);
+               terminal->pvt->flags.xn = _vte_terminfo_get_boolean(terminal->pvt->terminfo,
+                                                                   VTE_TERMINFO_VAR_EAT_NEWLINE_GLITCH);
 
                /* Resize to the given default. */
-               columns = _vte_termcap_find_numeric(terminal->pvt->termcap,
-                                                   terminal->pvt->emulation,
-                                                   "co");
+               columns = _vte_terminfo_get_numeric(terminal->pvt->terminfo,
+                                                   VTE_TERMINFO_VAR_COLUMNS);
                if (columns <= 0) {
                        columns = VTE_COLUMNS;
                }
                terminal->pvt->default_column_count = columns;
 
-               rows = _vte_termcap_find_numeric(terminal->pvt->termcap,
-                                                terminal->pvt->emulation,
-                                                "li");
+               rows = _vte_terminfo_get_numeric(terminal->pvt->terminfo,
+                                                 VTE_TERMINFO_VAR_LINES);
                if (rows <= 0 ) {
                        rows = VTE_ROWS;
                }
@@ -8143,9 +8128,9 @@ _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ..
        g_free (str);
 }
 
-/* Set the path to the termcap file we read, and read it in. */
+/* Set the path to the terminfo file we read, and read it in. */
 static void
-vte_terminal_set_termcap(VteTerminal *terminal)
+vte_terminal_set_terminfo(VteTerminal *terminal)
 {
         GObject *object = G_OBJECT(terminal);
         const char *emulation;
@@ -8155,14 +8140,14 @@ vte_terminal_set_termcap(VteTerminal *terminal)
         emulation = terminal->pvt->emulation ? terminal->pvt->emulation
                                              : vte_get_default_emulation();
 
-       _vte_debug_print(VTE_DEBUG_MISC, "Loading termcap `%s'...",
+       _vte_debug_print(VTE_DEBUG_MISC, "Loading terminfo `%s'...",
                         emulation);
-       if (terminal->pvt->termcap != NULL) {
-               _vte_termcap_free(terminal->pvt->termcap);
+       if (terminal->pvt->terminfo != NULL) {
+               _vte_terminfo_unref(terminal->pvt->terminfo);
        }
-       terminal->pvt->termcap = _vte_termcap_new(emulation);
+       terminal->pvt->terminfo = _vte_terminfo_new(emulation);
        _vte_debug_print(VTE_DEBUG_MISC, "\n");
-       if (terminal->pvt->termcap == NULL) {
+       if (terminal->pvt->terminfo == NULL) {
                _vte_terminal_inline_error_message(terminal,
                                "Failed to load terminal capabilities for '%s'",
                                emulation);
@@ -8178,7 +8163,7 @@ _vte_terminal_codeset_changed_cb(struct _vte_iso2022_state *state, gpointer p)
 }
 
 /* Initialize the terminal widget after the base widget stuff is initialized.
- * We need to create a new psuedo-terminal pair, read in the termcap file, and
+ * We need to create a new psuedo-terminal pair, read in the terminfo file, and
  * set ourselves up to do the interpretation of sequences. */
 static void
 vte_terminal_init(VteTerminal *terminal)
@@ -8254,7 +8239,7 @@ vte_terminal_init(VteTerminal *terminal)
        vte_terminal_set_encoding(terminal, NULL);
        g_assert(terminal->pvt->encoding != NULL);
 
-       /* Load the termcap data and set up the emulation. */
+       /* Load the terminfo data and set up the emulation. */
        pvt->keypad_mode = VTE_KEYMODE_NORMAL;
        pvt->cursor_mode = VTE_KEYMODE_NORMAL;
        pvt->dec_saved = g_hash_table_new(NULL, NULL);
@@ -8763,8 +8748,8 @@ vte_terminal_finalize(GObject *object)
        if (terminal->pvt->matcher != NULL) {
                _vte_matcher_free(terminal->pvt->matcher);
        }
-       if (terminal->pvt->termcap != NULL) {
-               _vte_termcap_free(terminal->pvt->termcap);
+       if (terminal->pvt->terminfo != NULL) {
+               _vte_terminfo_unref(terminal->pvt->terminfo);
        }
 
        remove_update_timeout (terminal);
@@ -10747,9 +10732,7 @@ vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event)
                                terminal->pvt->vt220_fkey_mode,
                                terminal->pvt->cursor_mode == VTE_KEYMODE_APPLICATION,
                                terminal->pvt->keypad_mode == VTE_KEYMODE_APPLICATION,
-                               terminal->pvt->termcap,
-                               terminal->pvt->emulation ?
-                               terminal->pvt->emulation : vte_get_default_emulation(),
+                               terminal->pvt->terminfo,
                                &normal,
                                &normal_length,
                                &special);
@@ -11706,14 +11689,14 @@ vte_terminal_class_init(VteTerminalClass *klass)
                                     VTE_TYPE_ERASE_BINDING,
                                     VTE_ERASE_AUTO,
                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-     
+
         /**
          * VteTerminal:emulation:
          *
          * Sets what type of terminal the widget attempts to emulate by scanning for
-         * control sequences defined in the system's termcap file.  Unless you
+         * control sequences defined in the system's terminfo file.  Unless you
          * are interested in this feature, always use the default which is "xterm".
-         * 
+         *
          * Since: 0.20
          */
         g_object_class_install_property
diff --git a/src/vte.gresource.xml.in b/src/vte.gresource.xml.in
index 1c39baf..1196a60 100644
--- a/src/vte.gresource.xml.in
+++ b/src/vte.gresource.xml.in
@@ -16,7 +16,4 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <gresources>
-  <gresource prefix="/org/gnome/vte/@VTE_API_VERSION@/termcap">
-    <file alias="xterm">@top_srcdir@/termcaps/xterm</file>
-  </gresource>
 </gresources>
diff --git a/src/vteconv.c b/src/vteconv.c
index ef94880..a64b0a0 100644
--- a/src/vteconv.c
+++ b/src/vteconv.c
@@ -18,15 +18,20 @@
 
 /* The interfaces in this file are subject to change at any time. */
 
+#include "config.h"
 
-#include <config.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <string.h>
 #include <glib.h>
 #include "buffer.h"
 #include "vteconv.h"
+
+#ifdef VTE_COMPILATION
 #include "vte-private.h"
+#else
+#define VTE_UTF8_BPC                    (6) /* Maximum number of bytes used per UTF-8 character */
+#endif
 
 typedef size_t (*convert_func)(GIConv converter,
                          const guchar **inbuf,
diff --git a/src/vteseq.c b/src/vteseq.c
index 077ca4f..41eb7b2 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -28,7 +28,7 @@
 
 #include "vte.h"
 #include "vte-private.h"
-#include "vtetc.h"
+#include "vteti.h"
 
 #define BEL "\007"
 #define ST _VTE_CAP_ST
@@ -397,22 +397,19 @@ _vte_terminal_scroll_text (VteTerminal *terminal, int scroll_amount)
 }
 
 static gboolean
-vte_terminal_termcap_string_same_as_for (VteTerminal *terminal,
-                                        const char  *cap_str,
-                                        const char  *cap_other)
+vte_terminal_terminfo_string_same_as_for (VteTerminal *terminal,
+                                          const char *cap_str,
+                                          guint var_other)
 {
-       char *other_str;
-       gboolean ret;
+       const char *other_str;
 
-       other_str = _vte_termcap_find_string(terminal->pvt->termcap,
-                                            terminal->pvt->emulation,
-                                            cap_other);
+       other_str = _vte_terminfo_get_string(terminal->pvt->terminfo,
+                                             var_other);
 
-       ret = other_str && (g_ascii_strcasecmp(cap_str, other_str) == 0);
-
-       g_free (other_str);
-
-       return ret;
+        /* FIXMEchpe: why case insensitive compare!? */
+        return cap_str &&
+               other_str &&
+               g_ascii_strcasecmp(cap_str, other_str) == 0;
 }
 
 /* Set icon/window titles. */
@@ -2004,7 +2001,7 @@ vte_sequence_handler_scroll_up (VteTerminal *terminal, GValueArray *params)
 static void
 vte_sequence_handler_se (VteTerminal *terminal, GValueArray *params)
 {
-       char *standout;
+       const char *standout;
 
        /* Standout may be mapped to another attribute, so attempt to do
         * the Right Thing here.
@@ -2012,24 +2009,22 @@ vte_sequence_handler_se (VteTerminal *terminal, GValueArray *params)
         * If the standout sequence is the same as another sequence, do what
         * we'd do for that other sequence instead. */
 
-       standout = _vte_termcap_find_string(terminal->pvt->termcap,
-                                           terminal->pvt->emulation,
-                                           "so");
-       g_assert(standout != NULL);
+       standout = _vte_terminfo_get_string(terminal->pvt->terminfo,
+                                            VTE_TERMINFO_VAR_ENTER_STANDOUT_MODE);
 
-       if (vte_terminal_termcap_string_same_as_for (terminal, standout, "mb") /* blink */   ||
-           vte_terminal_termcap_string_same_as_for (terminal, standout, "md") /* bold */    ||
-           vte_terminal_termcap_string_same_as_for (terminal, standout, "mh") /* half */    ||
-           vte_terminal_termcap_string_same_as_for (terminal, standout, "mr") /* reverse */ ||
-           vte_terminal_termcap_string_same_as_for (terminal, standout, "us") /* underline */)
+        /* FIXMEchpe: why not cache this in pvt? */
+       if (standout != NULL &&
+            (vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_BLINK_MODE)     /* blink */   ||
+             vte_terminal_terminfo_string_same_as_for (terminal, standout, VTE_TERMINFO_VAR_ENTER_BOLD_MODE) 
     /* bold */    ||
+             vte_terminal_terminfo_string_same_as_for (terminal, standout, VTE_TERMINFO_VAR_ENTER_DIM_MODE)  
     /* half */    ||
+             vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_REVERSE_MODE)   /* reverse */ ||
+             vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_UNDERLINE_MODE) /* underline */))
        {
                vte_sequence_handler_me (terminal, params);
        } else {
                /* Otherwise just set standout mode. */
                terminal->pvt->screen->defaults.attr.standout = 0;
        }
-
-       g_free(standout);
 }
 
 /* Cursor down, with scrolling. */
@@ -2051,7 +2046,7 @@ vte_sequence_handler_SF (VteTerminal *terminal, GValueArray *params)
 static void
 vte_sequence_handler_so (VteTerminal *terminal, GValueArray *params)
 {
-       char *standout;
+       const char *standout;
 
        /* Standout may be mapped to another attribute, so attempt to do
         * the Right Thing here.
@@ -2059,27 +2054,23 @@ vte_sequence_handler_so (VteTerminal *terminal, GValueArray *params)
         * If the standout sequence is the same as another sequence, do what
         * we'd do for that other sequence instead. */
 
-       standout = _vte_termcap_find_string(terminal->pvt->termcap,
-                                           terminal->pvt->emulation,
-                                           "so");
-       g_assert(standout != NULL);
+       standout = _vte_terminfo_get_string(terminal->pvt->terminfo,
+                                            VTE_TERMINFO_VAR_ENTER_STANDOUT_MODE);
 
-       if (vte_terminal_termcap_string_same_as_for (terminal, standout, "mb") /* blink */)
+       if (vte_terminal_terminfo_string_same_as_for (terminal, standout, VTE_TERMINFO_VAR_ENTER_BLINK_MODE) 
/* blink */)
                vte_sequence_handler_mb (terminal, params);
-       else if (vte_terminal_termcap_string_same_as_for (terminal, standout, "md") /* bold */)
+       else if (vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_BOLD_MODE) /* bold */)
                vte_sequence_handler_md (terminal, params);
-       else if (vte_terminal_termcap_string_same_as_for (terminal, standout, "mh") /* half */)
+       else if (vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_DIM_MODE) /* half */)
                vte_sequence_handler_mh (terminal, params);
-       else if (vte_terminal_termcap_string_same_as_for (terminal, standout, "mr") /* reverse */)
+       else if (vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_REVERSE_MODE) /* reverse */)
                vte_sequence_handler_mr (terminal, params);
-       else if (vte_terminal_termcap_string_same_as_for (terminal, standout, "us") /* underline */)
+       else if (vte_terminal_terminfo_string_same_as_for (terminal, standout, 
VTE_TERMINFO_VAR_ENTER_UNDERLINE_MODE) /* underline */)
                vte_sequence_handler_us (terminal, params);
        else {
                /* Otherwise just set standout mode. */
                terminal->pvt->screen->defaults.attr.standout = 1;
        }
-
-       g_free(standout);
 }
 
 /* Cursor up, scrolling if need be. */
@@ -3733,3 +3724,9 @@ _vte_terminal_handle_sequence(VteTerminal *terminal,
                                  match_s);
        }
 }
+
+gboolean
+ _vte_terminal_can_handle_sequence(const char *name)
+{
+        return _vte_sequence_get_handler(name) != NULL;
+}
diff --git a/src/vteti.c b/src/vteti.c
new file mode 100644
index 0000000..8b473ad
--- /dev/null
+++ b/src/vteti.c
@@ -0,0 +1,628 @@
+/*
+ * Copyright © 2014 Christian Persch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+
+#include "vteti.h"
+
+#include <limits.h>
+
+#include <ncurses.h>
+#include <term.h>
+#include <term_entry.h>
+#include <tic.h>
+
+struct _vte_terminfo
+{
+        int ref_count;
+        TERMTYPE termtype;
+};
+
+#define VTE_TERMINFO_VARTYPE_MASK (~(VTE_TERMINFO_VARTYPE_BOOLEAN | VTE_TERMINFO_VARTYPE_NUMERIC | 
VTE_TERMINFO_VARTYPE_STRING))
+
+static void
+_vte_terminfo_destroy(struct _vte_terminfo *terminfo)
+{
+        if (terminfo == NULL)
+                return;
+
+        _nc_free_termtype(&terminfo->termtype);
+        g_slice_free(struct _vte_terminfo, terminfo);
+}
+
+static struct _vte_terminfo *
+_vte_terminfo_create(const char *term)
+{
+        struct _vte_terminfo *terminfo;
+        char filename[PATH_MAX];
+        int r;
+
+        g_return_val_if_fail(term != NULL, NULL);
+
+        terminfo = g_slice_new0(struct _vte_terminfo);
+        terminfo->ref_count = 1;
+
+        r = _nc_read_entry(term, filename, &terminfo->termtype);
+        if (r != 1) {
+                _vte_terminfo_destroy(terminfo);
+                return NULL;
+        }
+
+        return terminfo;
+}
+
+/*
+ * _vte_terminfo_ref:
+ * @terminfo: a #_vte_terminfo
+ *
+ * Increases the ref count of @terminfo.
+ *
+ * Returns: @terminfo
+ */
+struct _vte_terminfo *
+_vte_terminfo_ref(struct _vte_terminfo *terminfo)
+{
+        g_return_val_if_fail(terminfo != NULL, NULL);
+        g_return_val_if_fail(terminfo->ref_count > 0, NULL);
+
+        g_atomic_int_inc(&terminfo->ref_count);
+        return terminfo;
+}
+
+/*
+ * _vte_terminfo_is_xterm_like:
+ * @terminfo: a #_vte_terminfo
+ *
+ * Checks whether the terminfo is for a xterm or xterm-like terminal.
+ *
+ * Returns: %TRUE if the terminfo is for a xterm or xterm-like terminal
+ */
+gboolean
+_vte_terminfo_is_xterm_like(struct _vte_terminfo *terminfo)
+{
+        /* const */ char *first_name;
+
+        g_return_val_if_fail(terminfo != NULL, FALSE);
+        first_name = _nc_first_name(terminfo->termtype.term_names);
+
+        return first_name != NULL &&
+                (g_str_has_prefix(first_name, "xterm") ||
+                 g_str_has_prefix(first_name, "vte") ||
+                 g_str_equal(first_name, "dtterm") /* FIXME: obsolete? */);
+}
+
+/*
+ * _vte_terminfo_get_boolean:
+ * @terminfo: a #_vte_terminfo
+ * @var: a terminfo variable of type %VTE_TERMINFO_VARTYPE_BOOLEAN
+ *
+ * Looks up the boolean terminfo capability @var.
+ *
+ * Returns: the value of the capability, or %FALSE if the capability is not set
+ */
+gboolean
+_vte_terminfo_get_boolean(struct _vte_terminfo *terminfo,
+                          guint variable)
+{
+        NCURSES_SBOOL b;
+
+        g_return_val_if_fail(terminfo != NULL, FALSE);
+        g_return_val_if_fail(variable & VTE_TERMINFO_VARTYPE_BOOLEAN, NULL);
+        variable &= VTE_TERMINFO_VARTYPE_MASK;
+        g_return_val_if_fail(variable < BOOLCOUNT, NULL);
+
+        b = terminfo->termtype.Booleans[variable];
+        return VALID_BOOLEAN(b) ? b != 0 : FALSE;
+}
+
+/*
+ * _vte_terminfo_get_numeric:
+ * @terminfo: a #_vte_terminfo
+ * @var: a terminfo variable of type %VTE_TERMINFO_VARTYPE_NUMERIC
+ *
+ * Looks up the numeric terminfo capability @var.
+ *
+ * Returns: the value of the capability, or -1 if the capability is not set
+ */
+int
+_vte_terminfo_get_numeric(struct _vte_terminfo *terminfo,
+                          guint variable)
+{
+        short n;
+
+        g_return_val_if_fail(terminfo != NULL, -1);
+        g_return_val_if_fail(variable & VTE_TERMINFO_VARTYPE_NUMERIC, NULL);
+        variable &= VTE_TERMINFO_VARTYPE_MASK;
+        g_return_val_if_fail(variable < NUMCOUNT, NULL);
+
+        n = terminfo->termtype.Numbers[variable];
+        return VALID_NUMERIC(n) ? (int)n : -1;
+}
+
+/*
+ * _vte_terminfo_get_string:
+ * @terminfo: a #_vte_terminfo
+ * @var: a terminfo variable of type %VTE_TERMINFO_VARTYPE_STRING
+ *
+ * Looks up the string terminfo capability @var.
+ *
+ * Returns: the value of the capability, or %NULL if the capability is not set
+ */
+const char *
+_vte_terminfo_get_string(struct _vte_terminfo *terminfo,
+                         guint variable)
+{
+        /* const */ char *str;
+
+        g_return_val_if_fail(terminfo != NULL, NULL);
+        g_return_val_if_fail(variable & VTE_TERMINFO_VARTYPE_STRING, NULL);
+        variable &= VTE_TERMINFO_VARTYPE_MASK;
+        g_return_val_if_fail(variable < STRCOUNT, NULL);
+
+        str = terminfo->termtype.Strings[variable];
+        return VALID_STRING(str) ? str : NULL;
+}
+
+/*
+ * _vte_terminfo_get_boolean_by_cap:
+ * @terminfo: a #_vte_terminfo
+ * @cap: a capability string for a boolean capability
+ * @compat: %TRUE if @cap is a termcap capability rather than a terminfo capability
+ *
+ * Looks up the boolean capability @cap.
+ * If @compat is %FALSE, @cap is a terminfo capability, else a termcap capability.
+ *
+ * Returns: the value of the capability, or %FALSE if the capability is not set
+ */
+gboolean
+_vte_terminfo_get_boolean_by_cap(struct _vte_terminfo *terminfo,
+                                 const char *cap,
+                                 gboolean compat)
+{
+        NCURSES_SBOOL b;
+        const struct name_table_entry *e;
+
+        g_return_val_if_fail(terminfo != NULL, FALSE);
+        g_return_val_if_fail(cap != NULL, FALSE);
+
+        e = _nc_find_entry(cap, _nc_get_hash_table(compat));
+        if (e == NULL)
+                return FALSE;
+
+        g_return_val_if_fail(e->nte_index < NUM_BOOLEANS(&terminfo->termtype), FALSE);
+
+        b = terminfo->termtype.Booleans[e->nte_index];
+        return VALID_BOOLEAN(b) ? b != 0 : FALSE;
+}
+
+/*
+ * _vte_terminfo_get_numeric_by_cap:
+ * @terminfo: a #_vte_terminfo
+ * @cap: a capability string for a numeric capability
+ * @compat: %TRUE if @cap is a termcap capability rather than a terminfo capability
+ *
+ * Looks up the numeric capability @cap.
+ * If @compat is %FALSE, @cap is a terminfo capability, else a termcap capability.
+ *
+ * Returns: the value of the capability, or -1 if the capability is not set
+ */
+int
+_vte_terminfo_get_numeric_by_cap(struct _vte_terminfo *terminfo,
+                                 const char *cap,
+                                 gboolean compat)
+{
+        short n;
+        const struct name_table_entry *e;
+
+        g_return_val_if_fail(terminfo != NULL, FALSE);
+        g_return_val_if_fail(cap != NULL, FALSE);
+
+        e = _nc_find_entry(cap, _nc_get_hash_table(compat));
+        if (e == NULL)
+                return -1;
+
+        g_return_val_if_fail(e->nte_index < NUM_NUMBERS(&terminfo->termtype), -1);
+
+        n = terminfo->termtype.Numbers[e->nte_index];
+        return VALID_NUMERIC(n) ? (int)n : -1;
+}
+
+/*
+ * _vte_terminfo_get_string_by_cap:
+ * @terminfo: a #_vte_terminfo
+ * @cap: a capability string for a string capability
+ * @compat: %TRUE if @cap is a termcap capability rather than a terminfo capability
+ *
+ * Looks up the string capability @cap.
+ * If @compat is %FALSE, @cap is a terminfo capability, else a termcap capability.
+ *
+ * Returns: the value of the capability, or %NULL if the capability is not set
+ */
+const char *
+_vte_terminfo_get_string_by_cap(struct _vte_terminfo *terminfo,
+                                const char *cap,
+                                gboolean compat)
+{
+        /* const */ char *str;
+        const struct name_table_entry *e;
+
+        g_return_val_if_fail(terminfo != NULL, FALSE);
+        g_return_val_if_fail(cap != NULL, FALSE);
+
+        e = _nc_find_entry(cap, _nc_get_hash_table(compat));
+        if (e == NULL)
+                return NULL;
+
+        g_return_val_if_fail(e->nte_index < NUM_STRINGS(&terminfo->termtype), NULL);
+
+        str = terminfo->termtype.Strings[e->nte_index];
+        return VALID_STRING(str) ? str : NULL;
+}
+
+/*
+ * _vte_terminfo_foreach_boolean_func:
+ * @terminfo: the #_vte_terminfo
+ * @cap: the terminfo capability
+ * @compat_cap: the corresponding termcap capability, or it does not exist in termcap
+ * @value: the value of the capability in @terminfo
+ * @user_data: user data
+ *
+ * A function type to pass to _vte_terminfo_foreach_boolean().
+ */
+
+/*
+ * _vte_terminfo_foreach_boolean:
+ * @terminfo: a #_vte_terminfo
+ * @include_extensions: whether to include extended capabilities
+ * @func: a #_vte_terminfo_foreach_boolean_func
+ * @user_data: user data to pass to @func
+ *
+ * Iterates over all boolean capabilities that are set in @terminfo.
+ * If @include_extensions is %TRUE, this includes extended capabilities, if there are any.
+ */
+void
+_vte_terminfo_foreach_boolean(struct _vte_terminfo *terminfo,
+                              gboolean include_extensions,
+                              _vte_terminfo_foreach_boolean_func func,
+                              gpointer user_data)
+{
+        NCURSES_SBOOL b;
+        TERMTYPE *tt;
+        int i;
+
+        g_return_if_fail(terminfo != NULL);
+        g_return_if_fail(func != NULL);
+
+        tt = &terminfo->termtype;
+        for_each_boolean(i, tt) {
+                if (G_UNLIKELY (i >= BOOLCOUNT && !include_extensions))
+                        continue;
+
+                b = tt->Booleans[i];
+                if (!VALID_BOOLEAN(b))
+                        continue;
+
+                func(terminfo,
+                     ExtBoolname(tt, i, boolnames),
+                     i < BOOLCOUNT ? boolcodes[i] : "",
+                     b != 0,
+                     user_data);
+        }
+}
+
+/*
+ * _vte_terminfo_foreach_numeric_func:
+ * @terminfo: the #_vte_terminfo
+ * @cap: the terminfo capability
+ * @compat_cap: the corresponding termcap capability, or it does not exist in termcap
+ * @value: the value of the capability in @terminfo
+ * @user_data: user data
+ *
+ * A function type to pass to _vte_terminfo_foreach_numeric().
+ */
+
+/*
+ * _vte_terminfo_foreach_numeric:
+ * @terminfo: a #_vte_terminfo
+ * @include_extensions: whether to include extended capabilities
+ * @func: a #_vte_terminfo_foreach_numeric_func
+ * @user_data: user data to pass to @func
+ *
+ * Iterates over all numeric capabilities that are set in @terminfo.
+ * If @include_extensions is %TRUE, this includes extended capabilities, if there are any.
+ */
+void
+_vte_terminfo_foreach_numeric(struct _vte_terminfo *terminfo,
+                              gboolean include_extensions,
+                              _vte_terminfo_foreach_numeric_func func,
+                              gpointer user_data)
+{
+        short n;
+        TERMTYPE *tt;
+        int i;
+
+        g_return_if_fail(terminfo != NULL);
+        g_return_if_fail(func != NULL);
+
+        tt = &terminfo->termtype;
+        for_each_number(i, tt) {
+                if (G_UNLIKELY (i >= NUMCOUNT && !include_extensions))
+                        continue;
+
+                n = tt->Numbers[i];
+                if (!VALID_NUMERIC(n))
+                        continue;
+
+                func(terminfo,
+                     ExtNumname(tt, i, numnames),
+                     i < NUMCOUNT ? numcodes[i] : "",
+                     n,
+                     user_data);
+        }
+}
+
+/*
+ * _vte_terminfo_foreach_string_func:
+ * @terminfo: the #_vte_terminfo
+ * @cap: the terminfo capability
+ * @compat_cap: the corresponding termcap capability, or it does not exist in termcap
+ * @value: the value of the capability in @terminfo
+ * @user_data: user data
+ *
+ * A function type to pass to _vte_terminfo_foreach_string().
+ */
+
+/*
+ * _vte_terminfo_foreach_string:
+ * @terminfo: a #_vte_terminfo
+ * @include_extensions: whether to include extended capabilities
+ * @func: a #_vte_terminfo_foreach_string_func
+ * @user_data: user data to pass to @func
+ *
+ * Iterates over all string capabilities that are set in @terminfo.
+ * If @include_extensions is %TRUE, this includes extended capabilities, if there are any.
+ */
+void
+_vte_terminfo_foreach_string(struct _vte_terminfo *terminfo,
+                             gboolean include_extensions,
+                             _vte_terminfo_foreach_string_func func,
+                             gpointer user_data)
+{
+        /* const */ char *str;
+        TERMTYPE *tt;
+        int i;
+
+        g_return_if_fail(terminfo != NULL);
+        g_return_if_fail(func != NULL);
+
+        tt = &terminfo->termtype;
+        for_each_string(i, tt) {
+                if (G_UNLIKELY (i >= STRCOUNT && !include_extensions))
+                        continue;
+
+                str = tt->Strings[i];
+                if (!VALID_STRING(str))
+                        continue;
+
+                func(terminfo,
+                     ExtStrname(tt, i, strnames),
+                     i < STRCOUNT ? strcodes[i] : "",
+                     str,
+                     user_data);
+        }
+}
+
+const char *
+_vte_terminfo_sequence_to_string(const char *str)
+{
+#if defined(VTE_DEBUG) || defined(TERMINFO_MAIN)
+        static const char codes[][6] = {
+                "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+                "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+                "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+                "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US",
+                "SPACE"
+        };
+        static GString *buf;
+        int i;
+
+        if (str == NULL)
+                return "(nil)";
+
+        if (buf == NULL)
+                buf = g_string_new(NULL);
+
+        g_string_truncate(buf, 0);
+        for (i = 0; str[i]; i++) {
+                guint8 c = (guint8)str[i];
+                if (i > 0)
+                        g_string_append_c(buf, ' ');
+
+                if (c <= 0x20)
+                        g_string_append(buf, codes[c]);
+                else if (c == 0x7f)
+                        g_string_append(buf, "DEL");
+                else if (c >= 0x80)
+                        g_string_append_printf(buf, "\\%02x ", c);
+                else
+                        g_string_append_c(buf, c);
+        }
+
+        return buf->str;
+#else
+        return NULL;
+#endif /* VTE_DEBUG || TERMINFO_MAIN */
+}
+
+/* Terminfo cache */
+
+static GHashTable *_vte_terminfo_cache = NULL;
+
+/*
+ * _vte_terminfo_new:
+ * @term: a terminfo name
+ *
+ * Looks up the #_vte_terminfo for @term in a cache, and if it does not exist,
+ * creates it.
+ *
+ * Returns: (transfer full): a reference to a #_vte_terminfo
+ */
+struct _vte_terminfo *
+_vte_terminfo_new(const char *term)
+{
+        struct _vte_terminfo *terminfo;
+
+        if (g_once_init_enter(&_vte_terminfo_cache)) {
+                GHashTable *cache;
+
+                cache = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                              (GDestroyNotify)g_free,
+                                              (GDestroyNotify)_vte_terminfo_destroy);
+                g_once_init_leave(&_vte_terminfo_cache, cache);
+        }
+
+        terminfo = g_hash_table_lookup(_vte_terminfo_cache, term);
+        if (terminfo == NULL) {
+                terminfo = _vte_terminfo_create(term);
+                g_hash_table_insert(_vte_terminfo_cache, g_strdup(term), terminfo);
+        }
+
+        return _vte_terminfo_ref(terminfo);
+}
+
+/*
+ * _vte_terminfo_ref:
+ * @terminfo: a #_vte_terminfo
+ *
+ * Decreases the ref count of @terminfo, and frees it if this had been
+ * the last reference.
+ */
+void
+_vte_terminfo_unref(struct _vte_terminfo *terminfo)
+{
+        if (g_atomic_int_dec_and_test(&terminfo->ref_count))
+                g_hash_table_remove(_vte_terminfo_cache, terminfo);
+}
+
+/* Main */
+
+#ifdef TERMINFO_MAIN
+
+#include <string.h>
+
+static void
+dump_boolean(struct _vte_terminfo *terminfo,
+             const char *cap,
+             const char *compat_cap,
+             gboolean value,
+             gpointer user_data)
+{
+        g_print("%-8s [ %2s ] = %s\n", cap, compat_cap ? compat_cap : "", value ? "true":"false");
+}
+
+static void
+dump_numeric(struct _vte_terminfo *terminfo,
+             const char *cap,
+             const char *compat_cap,
+             int value,
+             gpointer user_data)
+{
+        g_print("%-8s [ %2s ] = %d\n", cap, compat_cap ? compat_cap : "", value);
+}
+
+static void
+dump_string(struct _vte_terminfo *terminfo,
+            const char *cap,
+            const char *compat_cap,
+            const char *val,
+            gpointer user_data)
+{
+        g_print("%-8s [ %2s ] = %s\n", cap, compat_cap ? compat_cap : "",
+                _vte_terminfo_sequence_to_string(val));
+}
+
+static void
+dump(struct _vte_terminfo *terminfo)
+{
+        _vte_terminfo_foreach_boolean(terminfo, TRUE, dump_boolean, NULL);
+        _vte_terminfo_foreach_numeric(terminfo, TRUE, dump_numeric, NULL);
+        _vte_terminfo_foreach_string(terminfo, TRUE, dump_string, NULL);
+}
+
+int
+main(int argc, char *argv[])
+{
+        struct _vte_terminfo *terminfo;
+        const char *str;
+        int len, i, j;
+
+        if (argc < 2) {
+                g_printerr("%s TERM [ATTR..]\n"
+                           "  where ATTR are\n"
+                           "    :xx for boolean\n"
+                           "    #xx for numeric\n"
+                           "    =xx for string for display\n"
+                           "    +xx for string raw\n", argv[0]);
+                return 1;
+        }
+
+        terminfo = _vte_terminfo_create(argv[1]);
+        if (terminfo == NULL) {
+                g_printerr("Terminfo for \"%s\" not found.\n", argv[1]);
+                return 1;
+        }
+        if (argc == 2)
+                dump(terminfo);
+        else for (i = 2; i < argc; i++) {
+                gboolean compat = FALSE;
+
+                if (argv[i][0] == '-') {
+                        compat = TRUE;
+                        argv[i]++;
+                }
+
+                g_print("%s -> ", argv[i] + 1);
+                switch (argv[i][0])  {
+                case ':':
+                        g_print("%s\n",
+                                _vte_terminfo_get_boolean_by_cap(terminfo, argv[i] + 1, compat)
+                                ? "true" : "false");
+                        break;
+                case '=':
+                case '+':
+                        str = _vte_terminfo_get_string_by_cap(terminfo, argv[i] + 1, compat);
+                        if (argv[i][0] == '=') {
+                                g_print("%s\n", _vte_terminfo_sequence_to_string(str));
+                        } else {
+                                g_print("%s\n", str, strlen(str));
+                        }
+                        break;
+                case '#':
+                        g_print("%d\n", _vte_terminfo_get_numeric_by_cap(terminfo, argv[i] + 1, compat));
+                        break;
+                default:
+                        g_printerr("unrecognised type '%c'\n", argv[i][0]);
+                }
+        }
+
+        _vte_terminfo_destroy(terminfo);
+
+        return 0;
+}
+
+#endif /* TERMINFO_MAIN */
diff --git a/src/vteti.h b/src/vteti.h
new file mode 100644
index 0000000..dbe9d24
--- /dev/null
+++ b/src/vteti.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright © 2014 Christian Persch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __VTE_TERMINFO_H__
+#define __VTE_TERMINFO_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define VTE_TERMINFO_VARTYPE_BOOLEAN (1U << 13)
+#define VTE_TERMINFO_VARTYPE_NUMERIC (1U << 14)
+#define VTE_TERMINFO_VARTYPE_STRING  (1U << 15)
+
+struct _vte_terminfo;
+
+struct _vte_terminfo *_vte_terminfo_new(const char *term);
+
+struct _vte_terminfo *_vte_terminfo_ref(struct _vte_terminfo *terminfo);
+void _vte_terminfo_unref(struct _vte_terminfo *terminfo);
+
+gboolean _vte_terminfo_is_xterm_like(struct _vte_terminfo *terminfo);
+
+typedef void (* _vte_terminfo_foreach_boolean_func)(struct _vte_terminfo *terminfo,
+                                                    const char *cap,
+                                                    const char *compat_cap,
+                                                    gboolean value,
+                                                    gpointer user_data);
+
+gboolean _vte_terminfo_get_boolean(struct _vte_terminfo *terminfo,
+                                   guint variable);
+gboolean _vte_terminfo_get_boolean_by_cap(struct _vte_terminfo *terminfo,
+                                          const char *cap,
+                                          gboolean compat);
+void _vte_terminfo_foreach_boolean(struct _vte_terminfo *terminfo,
+                                   gboolean include_extensions,
+                                   _vte_terminfo_foreach_boolean_func func,
+                                   gpointer user_data);
+
+typedef void (* _vte_terminfo_foreach_numeric_func)(struct _vte_terminfo *terminfo,
+                                                    const char *cap,
+                                                    const char *compat_cap,
+                                                    int value,
+                                                    gpointer user_data);
+
+int _vte_terminfo_get_numeric(struct _vte_terminfo *terminfo,
+                              guint variable);
+int _vte_terminfo_get_numeric_by_cap(struct _vte_terminfo *terminfo,
+                                     const char *cap,
+                                     gboolean compat);
+void _vte_terminfo_foreach_numeric(struct _vte_terminfo *terminfo,
+                                   gboolean include_extensions,
+                                   _vte_terminfo_foreach_numeric_func func,
+                                   gpointer user_data);
+
+typedef void (* _vte_terminfo_foreach_string_func) (struct _vte_terminfo *terminfo,
+                                                    const char *cap,
+                                                    const char *compat_cap,
+                                                    const char *value,
+                                                    gpointer user_data);
+
+const char * _vte_terminfo_get_string(struct _vte_terminfo *terminfo,
+                                      guint variable);
+const char * _vte_terminfo_get_string_by_cap(struct _vte_terminfo *terminfo,
+                                             const char *cap,
+                                             gboolean compat);
+void _vte_terminfo_foreach_string(struct _vte_terminfo *terminfo,
+                                  gboolean include_extensions,
+                                  _vte_terminfo_foreach_string_func func,
+                                  gpointer user_data);
+
+const char * _vte_terminfo_sequence_to_string(const char *str);
+
+G_END_DECLS
+
+/* Capability defines */
+#include "vtetivars.h"
+
+#endif /* __VTE_TERMINFO_H__ */
diff --git a/src/vtetivars.awk b/src/vtetivars.awk
new file mode 100644
index 0000000..938265d
--- /dev/null
+++ b/src/vtetivars.awk
@@ -0,0 +1,83 @@
+BEGIN {
+    print "/******************************************************************************"
+    print " * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.                *"
+    print " *                                                                            *"
+    print " * Permission is hereby granted, free of charge, to any person obtaining a    *"
+    print " * copy of this software and associated documentation files (the 'Software'), *"
+    print " * to deal in the Software without restriction, including without limitation  *"
+    print " * the rights to use, copy, modify, merge, publish, distribute, distribute    *"
+    print " * with modifications, sublicense, and/or sell copies of the Software, and to *"
+    print " * permit persons to whom the Software is furnished to do so, subject to the  *"
+    print " * following conditions:                                                      *"
+    print " *                                                                            *"
+    print " * The above copyright notice and this permission notice shall be included in *"
+    print " * all copies or substantial portions of the Software.                        *"
+    print " *                                                                            *"
+    print " * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *"
+    print " * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *"
+    print " * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    *"
+    print " * THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      *"
+    print " * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    *"
+    print " * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        *"
+    print " * DEALINGS IN THE SOFTWARE.                                                  *"
+    print " *                                                                            *"
+    print " * Except as contained in this notice, the name(s) of the above copyright     *"
+    print " * holders shall not be used in advertising or otherwise to promote the sale, *"
+    print " * use or other dealings in this Software without prior written               *"
+    print " * authorization.                                                             *"
+    print " ******************************************************************************/"
+    print ""
+    print "/* Generated from ncurses/include/Caps from the ncurses sources; you can get it here for example:"
+    print " * 
http://anonscm.debian.org/gitweb/?p=collab-maint/ncurses.git;a=blob_plain;f=include/Caps;h=cb650a6be900c9d460498aa46d7843a11da57446;hb=refs/heads/upstream";
+    print " */"
+    print ""
+    print "#ifndef __VTE_TERMINFO_VARS_H__"
+    print "#define __VTE_TERMINFO_VARS_H__"
+    print ""
+}
+
+$2 == "%%-STOP-HERE-%%" {
+    nextfile;
+}
+
+/^#/ {
+    next; 
+}
+
+{ 
+    printf "#define VTE_TERMINFO_CAP_%-30s \"%s\"\n", toupper($1), $2;
+}
+# {
+#     printf "#define VTE_TERMINFO_IS_CAP_%-27s (", toupper($1) "(c)";
+#     for (i = 0; i < length($2); i++) {
+#         printf "(c)[%d] == '%c' && ", i, substr($2, i + 1, 1);
+#     }
+#     printf "(c)[%d] == 0)\n", i;
+# }
+# {
+#     printf "#define VTE_TERMCAP_CAP_%-32s \"%s\"\n", toupper($1), $4;
+# }
+
+$3 == "bool" {
+    printf "#define VTE_TERMINFO_VAR_%-30s (%3d | VTE_TERMINFO_VARTYPE_BOOLEAN)\n",
+        toupper($1), nbools++;
+}
+$3 == "num" {
+    printf "#define VTE_TERMINFO_VAR_%-30s (%3d | VTE_TERMINFO_VARTYPE_NUMERIC)\n",
+        toupper($1), nnums++;
+}
+$3 == "str" {
+    printf "#define VTE_TERMINFO_VAR_%-30s (%3d | VTE_TERMINFO_VARTYPE_STRING)\n",
+        toupper($1), nstrs++;
+}
+
+END {
+    print ""
+#   print "#define VTE_TERMINFO_NUM_BOOLEAN_VARS ", nbools
+#   print "#define VTE_TERMINFO_NUM_INT_VARS     ", nnums
+#   print "#define VTE_TERMINFO_NUM_STRING_VARS  ", nstrs
+#   print ""
+#   print "/* FIXME! Defines for the common extended names, used e.g.f for extended xterm key strings */"
+    print ""
+    print "#endif /* __VTE_TERMINFO_VARS_H__ */"
+}
diff --git a/src/vtetivars.h b/src/vtetivars.h
new file mode 100644
index 0000000..73b23b5
--- /dev/null
+++ b/src/vtetivars.h
@@ -0,0 +1,966 @@
+/******************************************************************************
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.                *
+ *                                                                            *
+ * Permission is hereby granted, free of charge, to any person obtaining a    *
+ * copy of this software and associated documentation files (the 'Software'), *
+ * to deal in the Software without restriction, including without limitation  *
+ * the rights to use, copy, modify, merge, publish, distribute, distribute    *
+ * with modifications, sublicense, and/or sell copies of the Software, and to *
+ * permit persons to whom the Software is furnished to do so, subject to the  *
+ * following conditions:                                                      *
+ *                                                                            *
+ * The above copyright notice and this permission notice shall be included in *
+ * all copies or substantial portions of the Software.                        *
+ *                                                                            *
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    *
+ * THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      *
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    *
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        *
+ * DEALINGS IN THE SOFTWARE.                                                  *
+ *                                                                            *
+ * Except as contained in this notice, the name(s) of the above copyright     *
+ * holders shall not be used in advertising or otherwise to promote the sale, *
+ * use or other dealings in this Software without prior written               *
+ * authorization.                                                             *
+ ******************************************************************************/
+
+/* Generated from ncurses/include/Caps from the ncurses sources; you can get it here for example:
+ * 
http://anonscm.debian.org/gitweb/?p=collab-maint/ncurses.git;a=blob_plain;f=include/Caps;h=cb650a6be900c9d460498aa46d7843a11da57446;hb=refs/heads/upstream
+ */
+
+#ifndef __VTE_TERMINFO_VARS_H__
+#define __VTE_TERMINFO_VARS_H__
+
+#define VTE_TERMINFO_CAP_AUTO_LEFT_MARGIN               "bw"
+#define VTE_TERMINFO_VAR_AUTO_LEFT_MARGIN               (  0 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_AUTO_RIGHT_MARGIN              "am"
+#define VTE_TERMINFO_VAR_AUTO_RIGHT_MARGIN              (  1 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_NO_ESC_CTLC                    "xsb"
+#define VTE_TERMINFO_VAR_NO_ESC_CTLC                    (  2 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_CEOL_STANDOUT_GLITCH           "xhp"
+#define VTE_TERMINFO_VAR_CEOL_STANDOUT_GLITCH           (  3 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_EAT_NEWLINE_GLITCH             "xenl"
+#define VTE_TERMINFO_VAR_EAT_NEWLINE_GLITCH             (  4 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_ERASE_OVERSTRIKE               "eo"
+#define VTE_TERMINFO_VAR_ERASE_OVERSTRIKE               (  5 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_GENERIC_TYPE                   "gn"
+#define VTE_TERMINFO_VAR_GENERIC_TYPE                   (  6 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_HARD_COPY                      "hc"
+#define VTE_TERMINFO_VAR_HARD_COPY                      (  7 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_HAS_META_KEY                   "km"
+#define VTE_TERMINFO_VAR_HAS_META_KEY                   (  8 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_HAS_STATUS_LINE                "hs"
+#define VTE_TERMINFO_VAR_HAS_STATUS_LINE                (  9 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_INSERT_NULL_GLITCH             "in"
+#define VTE_TERMINFO_VAR_INSERT_NULL_GLITCH             ( 10 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_MEMORY_ABOVE                   "da"
+#define VTE_TERMINFO_VAR_MEMORY_ABOVE                   ( 11 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_MEMORY_BELOW                   "db"
+#define VTE_TERMINFO_VAR_MEMORY_BELOW                   ( 12 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_MOVE_INSERT_MODE               "mir"
+#define VTE_TERMINFO_VAR_MOVE_INSERT_MODE               ( 13 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_MOVE_STANDOUT_MODE             "msgr"
+#define VTE_TERMINFO_VAR_MOVE_STANDOUT_MODE             ( 14 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_OVER_STRIKE                    "os"
+#define VTE_TERMINFO_VAR_OVER_STRIKE                    ( 15 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_STATUS_LINE_ESC_OK             "eslok"
+#define VTE_TERMINFO_VAR_STATUS_LINE_ESC_OK             ( 16 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_DEST_TABS_MAGIC_SMSO           "xt"
+#define VTE_TERMINFO_VAR_DEST_TABS_MAGIC_SMSO           ( 17 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_TILDE_GLITCH                   "hz"
+#define VTE_TERMINFO_VAR_TILDE_GLITCH                   ( 18 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_TRANSPARENT_UNDERLINE          "ul"
+#define VTE_TERMINFO_VAR_TRANSPARENT_UNDERLINE          ( 19 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_XON_XOFF                       "xon"
+#define VTE_TERMINFO_VAR_XON_XOFF                       ( 20 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_NEEDS_XON_XOFF                 "nxon"
+#define VTE_TERMINFO_VAR_NEEDS_XON_XOFF                 ( 21 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_PRTR_SILENT                    "mc5i"
+#define VTE_TERMINFO_VAR_PRTR_SILENT                    ( 22 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_HARD_CURSOR                    "chts"
+#define VTE_TERMINFO_VAR_HARD_CURSOR                    ( 23 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_NON_REV_RMCUP                  "nrrmc"
+#define VTE_TERMINFO_VAR_NON_REV_RMCUP                  ( 24 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_NO_PAD_CHAR                    "npc"
+#define VTE_TERMINFO_VAR_NO_PAD_CHAR                    ( 25 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_NON_DEST_SCROLL_REGION         "ndscr"
+#define VTE_TERMINFO_VAR_NON_DEST_SCROLL_REGION         ( 26 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_CAN_CHANGE                     "ccc"
+#define VTE_TERMINFO_VAR_CAN_CHANGE                     ( 27 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_BACK_COLOR_ERASE               "bce"
+#define VTE_TERMINFO_VAR_BACK_COLOR_ERASE               ( 28 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_HUE_LIGHTNESS_SATURATION       "hls"
+#define VTE_TERMINFO_VAR_HUE_LIGHTNESS_SATURATION       ( 29 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_COL_ADDR_GLITCH                "xhpa"
+#define VTE_TERMINFO_VAR_COL_ADDR_GLITCH                ( 30 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_CR_CANCELS_MICRO_MODE          "crxm"
+#define VTE_TERMINFO_VAR_CR_CANCELS_MICRO_MODE          ( 31 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_HAS_PRINT_WHEEL                "daisy"
+#define VTE_TERMINFO_VAR_HAS_PRINT_WHEEL                ( 32 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_ROW_ADDR_GLITCH                "xvpa"
+#define VTE_TERMINFO_VAR_ROW_ADDR_GLITCH                ( 33 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_SEMI_AUTO_RIGHT_MARGIN         "sam"
+#define VTE_TERMINFO_VAR_SEMI_AUTO_RIGHT_MARGIN         ( 34 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_CPI_CHANGES_RES                "cpix"
+#define VTE_TERMINFO_VAR_CPI_CHANGES_RES                ( 35 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_LPI_CHANGES_RES                "lpix"
+#define VTE_TERMINFO_VAR_LPI_CHANGES_RES                ( 36 | VTE_TERMINFO_VARTYPE_BOOLEAN)
+#define VTE_TERMINFO_CAP_COLUMNS                        "cols"
+#define VTE_TERMINFO_VAR_COLUMNS                        (  0 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_INIT_TABS                      "it"
+#define VTE_TERMINFO_VAR_INIT_TABS                      (  1 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_LINES                          "lines"
+#define VTE_TERMINFO_VAR_LINES                          (  2 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_LINES_OF_MEMORY                "lm"
+#define VTE_TERMINFO_VAR_LINES_OF_MEMORY                (  3 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAGIC_COOKIE_GLITCH            "xmc"
+#define VTE_TERMINFO_VAR_MAGIC_COOKIE_GLITCH            (  4 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_PADDING_BAUD_RATE              "pb"
+#define VTE_TERMINFO_VAR_PADDING_BAUD_RATE              (  5 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_VIRTUAL_TERMINAL               "vt"
+#define VTE_TERMINFO_VAR_VIRTUAL_TERMINAL               (  6 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_WIDTH_STATUS_LINE              "wsl"
+#define VTE_TERMINFO_VAR_WIDTH_STATUS_LINE              (  7 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_NUM_LABELS                     "nlab"
+#define VTE_TERMINFO_VAR_NUM_LABELS                     (  8 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_LABEL_HEIGHT                   "lh"
+#define VTE_TERMINFO_VAR_LABEL_HEIGHT                   (  9 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_LABEL_WIDTH                    "lw"
+#define VTE_TERMINFO_VAR_LABEL_WIDTH                    ( 10 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAX_ATTRIBUTES                 "ma"
+#define VTE_TERMINFO_VAR_MAX_ATTRIBUTES                 ( 11 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAXIMUM_WINDOWS                "wnum"
+#define VTE_TERMINFO_VAR_MAXIMUM_WINDOWS                ( 12 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAX_COLORS                     "colors"
+#define VTE_TERMINFO_VAR_MAX_COLORS                     ( 13 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAX_PAIRS                      "pairs"
+#define VTE_TERMINFO_VAR_MAX_PAIRS                      ( 14 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_NO_COLOR_VIDEO                 "ncv"
+#define VTE_TERMINFO_VAR_NO_COLOR_VIDEO                 ( 15 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_BUFFER_CAPACITY                "bufsz"
+#define VTE_TERMINFO_VAR_BUFFER_CAPACITY                ( 16 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_DOT_VERT_SPACING               "spinv"
+#define VTE_TERMINFO_VAR_DOT_VERT_SPACING               ( 17 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_DOT_HORZ_SPACING               "spinh"
+#define VTE_TERMINFO_VAR_DOT_HORZ_SPACING               ( 18 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAX_MICRO_ADDRESS              "maddr"
+#define VTE_TERMINFO_VAR_MAX_MICRO_ADDRESS              ( 19 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MAX_MICRO_JUMP                 "mjump"
+#define VTE_TERMINFO_VAR_MAX_MICRO_JUMP                 ( 20 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MICRO_COL_SIZE                 "mcs"
+#define VTE_TERMINFO_VAR_MICRO_COL_SIZE                 ( 21 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_MICRO_LINE_SIZE                "mls"
+#define VTE_TERMINFO_VAR_MICRO_LINE_SIZE                ( 22 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_NUMBER_OF_PINS                 "npins"
+#define VTE_TERMINFO_VAR_NUMBER_OF_PINS                 ( 23 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_OUTPUT_RES_CHAR                "orc"
+#define VTE_TERMINFO_VAR_OUTPUT_RES_CHAR                ( 24 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_OUTPUT_RES_LINE                "orl"
+#define VTE_TERMINFO_VAR_OUTPUT_RES_LINE                ( 25 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_OUTPUT_RES_HORZ_INCH           "orhi"
+#define VTE_TERMINFO_VAR_OUTPUT_RES_HORZ_INCH           ( 26 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_OUTPUT_RES_VERT_INCH           "orvi"
+#define VTE_TERMINFO_VAR_OUTPUT_RES_VERT_INCH           ( 27 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_PRINT_RATE                     "cps"
+#define VTE_TERMINFO_VAR_PRINT_RATE                     ( 28 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_WIDE_CHAR_SIZE                 "widcs"
+#define VTE_TERMINFO_VAR_WIDE_CHAR_SIZE                 ( 29 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_BUTTONS                        "btns"
+#define VTE_TERMINFO_VAR_BUTTONS                        ( 30 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_BIT_IMAGE_ENTWINING            "bitwin"
+#define VTE_TERMINFO_VAR_BIT_IMAGE_ENTWINING            ( 31 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_BIT_IMAGE_TYPE                 "bitype"
+#define VTE_TERMINFO_VAR_BIT_IMAGE_TYPE                 ( 32 | VTE_TERMINFO_VARTYPE_NUMERIC)
+#define VTE_TERMINFO_CAP_BACK_TAB                       "cbt"
+#define VTE_TERMINFO_VAR_BACK_TAB                       (  0 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_BELL                           "bel"
+#define VTE_TERMINFO_VAR_BELL                           (  1 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CARRIAGE_RETURN                "cr"
+#define VTE_TERMINFO_VAR_CARRIAGE_RETURN                (  2 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHANGE_SCROLL_REGION           "csr"
+#define VTE_TERMINFO_VAR_CHANGE_SCROLL_REGION           (  3 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CLEAR_ALL_TABS                 "tbc"
+#define VTE_TERMINFO_VAR_CLEAR_ALL_TABS                 (  4 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CLEAR_SCREEN                   "clear"
+#define VTE_TERMINFO_VAR_CLEAR_SCREEN                   (  5 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CLR_EOL                        "el"
+#define VTE_TERMINFO_VAR_CLR_EOL                        (  6 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CLR_EOS                        "ed"
+#define VTE_TERMINFO_VAR_CLR_EOS                        (  7 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_COLUMN_ADDRESS                 "hpa"
+#define VTE_TERMINFO_VAR_COLUMN_ADDRESS                 (  8 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_COMMAND_CHARACTER              "cmdch"
+#define VTE_TERMINFO_VAR_COMMAND_CHARACTER              (  9 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_ADDRESS                 "cup"
+#define VTE_TERMINFO_VAR_CURSOR_ADDRESS                 ( 10 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_DOWN                    "cud1"
+#define VTE_TERMINFO_VAR_CURSOR_DOWN                    ( 11 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_HOME                    "home"
+#define VTE_TERMINFO_VAR_CURSOR_HOME                    ( 12 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_INVISIBLE               "civis"
+#define VTE_TERMINFO_VAR_CURSOR_INVISIBLE               ( 13 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_LEFT                    "cub1"
+#define VTE_TERMINFO_VAR_CURSOR_LEFT                    ( 14 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_MEM_ADDRESS             "mrcup"
+#define VTE_TERMINFO_VAR_CURSOR_MEM_ADDRESS             ( 15 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_NORMAL                  "cnorm"
+#define VTE_TERMINFO_VAR_CURSOR_NORMAL                  ( 16 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_RIGHT                   "cuf1"
+#define VTE_TERMINFO_VAR_CURSOR_RIGHT                   ( 17 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_TO_LL                   "ll"
+#define VTE_TERMINFO_VAR_CURSOR_TO_LL                   ( 18 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_UP                      "cuu1"
+#define VTE_TERMINFO_VAR_CURSOR_UP                      ( 19 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CURSOR_VISIBLE                 "cvvis"
+#define VTE_TERMINFO_VAR_CURSOR_VISIBLE                 ( 20 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DELETE_CHARACTER               "dch1"
+#define VTE_TERMINFO_VAR_DELETE_CHARACTER               ( 21 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DELETE_LINE                    "dl1"
+#define VTE_TERMINFO_VAR_DELETE_LINE                    ( 22 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DIS_STATUS_LINE                "dsl"
+#define VTE_TERMINFO_VAR_DIS_STATUS_LINE                ( 23 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DOWN_HALF_LINE                 "hd"
+#define VTE_TERMINFO_VAR_DOWN_HALF_LINE                 ( 24 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_ALT_CHARSET_MODE         "smacs"
+#define VTE_TERMINFO_VAR_ENTER_ALT_CHARSET_MODE         ( 25 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_BLINK_MODE               "blink"
+#define VTE_TERMINFO_VAR_ENTER_BLINK_MODE               ( 26 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_BOLD_MODE                "bold"
+#define VTE_TERMINFO_VAR_ENTER_BOLD_MODE                ( 27 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_CA_MODE                  "smcup"
+#define VTE_TERMINFO_VAR_ENTER_CA_MODE                  ( 28 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_DELETE_MODE              "smdc"
+#define VTE_TERMINFO_VAR_ENTER_DELETE_MODE              ( 29 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_DIM_MODE                 "dim"
+#define VTE_TERMINFO_VAR_ENTER_DIM_MODE                 ( 30 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_INSERT_MODE              "smir"
+#define VTE_TERMINFO_VAR_ENTER_INSERT_MODE              ( 31 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_SECURE_MODE              "invis"
+#define VTE_TERMINFO_VAR_ENTER_SECURE_MODE              ( 32 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_PROTECTED_MODE           "prot"
+#define VTE_TERMINFO_VAR_ENTER_PROTECTED_MODE           ( 33 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_REVERSE_MODE             "rev"
+#define VTE_TERMINFO_VAR_ENTER_REVERSE_MODE             ( 34 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_STANDOUT_MODE            "smso"
+#define VTE_TERMINFO_VAR_ENTER_STANDOUT_MODE            ( 35 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_UNDERLINE_MODE           "smul"
+#define VTE_TERMINFO_VAR_ENTER_UNDERLINE_MODE           ( 36 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ERASE_CHARS                    "ech"
+#define VTE_TERMINFO_VAR_ERASE_CHARS                    ( 37 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_ALT_CHARSET_MODE          "rmacs"
+#define VTE_TERMINFO_VAR_EXIT_ALT_CHARSET_MODE          ( 38 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_ATTRIBUTE_MODE            "sgr0"
+#define VTE_TERMINFO_VAR_EXIT_ATTRIBUTE_MODE            ( 39 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_CA_MODE                   "rmcup"
+#define VTE_TERMINFO_VAR_EXIT_CA_MODE                   ( 40 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_DELETE_MODE               "rmdc"
+#define VTE_TERMINFO_VAR_EXIT_DELETE_MODE               ( 41 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_INSERT_MODE               "rmir"
+#define VTE_TERMINFO_VAR_EXIT_INSERT_MODE               ( 42 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_STANDOUT_MODE             "rmso"
+#define VTE_TERMINFO_VAR_EXIT_STANDOUT_MODE             ( 43 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_UNDERLINE_MODE            "rmul"
+#define VTE_TERMINFO_VAR_EXIT_UNDERLINE_MODE            ( 44 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_FLASH_SCREEN                   "flash"
+#define VTE_TERMINFO_VAR_FLASH_SCREEN                   ( 45 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_FORM_FEED                      "ff"
+#define VTE_TERMINFO_VAR_FORM_FEED                      ( 46 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_FROM_STATUS_LINE               "fsl"
+#define VTE_TERMINFO_VAR_FROM_STATUS_LINE               ( 47 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INIT_1STRING                   "is1"
+#define VTE_TERMINFO_VAR_INIT_1STRING                   ( 48 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INIT_2STRING                   "is2"
+#define VTE_TERMINFO_VAR_INIT_2STRING                   ( 49 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INIT_3STRING                   "is3"
+#define VTE_TERMINFO_VAR_INIT_3STRING                   ( 50 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INIT_FILE                      "if"
+#define VTE_TERMINFO_VAR_INIT_FILE                      ( 51 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INSERT_CHARACTER               "ich1"
+#define VTE_TERMINFO_VAR_INSERT_CHARACTER               ( 52 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INSERT_LINE                    "il1"
+#define VTE_TERMINFO_VAR_INSERT_LINE                    ( 53 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INSERT_PADDING                 "ip"
+#define VTE_TERMINFO_VAR_INSERT_PADDING                 ( 54 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_BACKSPACE                  "kbs"
+#define VTE_TERMINFO_VAR_KEY_BACKSPACE                  ( 55 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_CATAB                      "ktbc"
+#define VTE_TERMINFO_VAR_KEY_CATAB                      ( 56 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_CLEAR                      "kclr"
+#define VTE_TERMINFO_VAR_KEY_CLEAR                      ( 57 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_CTAB                       "kctab"
+#define VTE_TERMINFO_VAR_KEY_CTAB                       ( 58 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_DC                         "kdch1"
+#define VTE_TERMINFO_VAR_KEY_DC                         ( 59 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_DL                         "kdl1"
+#define VTE_TERMINFO_VAR_KEY_DL                         ( 60 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_DOWN                       "kcud1"
+#define VTE_TERMINFO_VAR_KEY_DOWN                       ( 61 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_EIC                        "krmir"
+#define VTE_TERMINFO_VAR_KEY_EIC                        ( 62 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_EOL                        "kel"
+#define VTE_TERMINFO_VAR_KEY_EOL                        ( 63 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_EOS                        "ked"
+#define VTE_TERMINFO_VAR_KEY_EOS                        ( 64 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F0                         "kf0"
+#define VTE_TERMINFO_VAR_KEY_F0                         ( 65 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F1                         "kf1"
+#define VTE_TERMINFO_VAR_KEY_F1                         ( 66 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F10                        "kf10"
+#define VTE_TERMINFO_VAR_KEY_F10                        ( 67 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F2                         "kf2"
+#define VTE_TERMINFO_VAR_KEY_F2                         ( 68 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F3                         "kf3"
+#define VTE_TERMINFO_VAR_KEY_F3                         ( 69 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F4                         "kf4"
+#define VTE_TERMINFO_VAR_KEY_F4                         ( 70 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F5                         "kf5"
+#define VTE_TERMINFO_VAR_KEY_F5                         ( 71 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F6                         "kf6"
+#define VTE_TERMINFO_VAR_KEY_F6                         ( 72 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F7                         "kf7"
+#define VTE_TERMINFO_VAR_KEY_F7                         ( 73 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F8                         "kf8"
+#define VTE_TERMINFO_VAR_KEY_F8                         ( 74 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F9                         "kf9"
+#define VTE_TERMINFO_VAR_KEY_F9                         ( 75 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_HOME                       "khome"
+#define VTE_TERMINFO_VAR_KEY_HOME                       ( 76 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_IC                         "kich1"
+#define VTE_TERMINFO_VAR_KEY_IC                         ( 77 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_IL                         "kil1"
+#define VTE_TERMINFO_VAR_KEY_IL                         ( 78 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_LEFT                       "kcub1"
+#define VTE_TERMINFO_VAR_KEY_LEFT                       ( 79 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_LL                         "kll"
+#define VTE_TERMINFO_VAR_KEY_LL                         ( 80 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_NPAGE                      "knp"
+#define VTE_TERMINFO_VAR_KEY_NPAGE                      ( 81 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_PPAGE                      "kpp"
+#define VTE_TERMINFO_VAR_KEY_PPAGE                      ( 82 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_RIGHT                      "kcuf1"
+#define VTE_TERMINFO_VAR_KEY_RIGHT                      ( 83 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SF                         "kind"
+#define VTE_TERMINFO_VAR_KEY_SF                         ( 84 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SR                         "kri"
+#define VTE_TERMINFO_VAR_KEY_SR                         ( 85 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_STAB                       "khts"
+#define VTE_TERMINFO_VAR_KEY_STAB                       ( 86 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_UP                         "kcuu1"
+#define VTE_TERMINFO_VAR_KEY_UP                         ( 87 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEYPAD_LOCAL                   "rmkx"
+#define VTE_TERMINFO_VAR_KEYPAD_LOCAL                   ( 88 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEYPAD_XMIT                    "smkx"
+#define VTE_TERMINFO_VAR_KEYPAD_XMIT                    ( 89 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F0                         "lf0"
+#define VTE_TERMINFO_VAR_LAB_F0                         ( 90 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F1                         "lf1"
+#define VTE_TERMINFO_VAR_LAB_F1                         ( 91 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F10                        "lf10"
+#define VTE_TERMINFO_VAR_LAB_F10                        ( 92 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F2                         "lf2"
+#define VTE_TERMINFO_VAR_LAB_F2                         ( 93 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F3                         "lf3"
+#define VTE_TERMINFO_VAR_LAB_F3                         ( 94 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F4                         "lf4"
+#define VTE_TERMINFO_VAR_LAB_F4                         ( 95 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F5                         "lf5"
+#define VTE_TERMINFO_VAR_LAB_F5                         ( 96 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F6                         "lf6"
+#define VTE_TERMINFO_VAR_LAB_F6                         ( 97 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F7                         "lf7"
+#define VTE_TERMINFO_VAR_LAB_F7                         ( 98 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F8                         "lf8"
+#define VTE_TERMINFO_VAR_LAB_F8                         ( 99 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LAB_F9                         "lf9"
+#define VTE_TERMINFO_VAR_LAB_F9                         (100 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_META_OFF                       "rmm"
+#define VTE_TERMINFO_VAR_META_OFF                       (101 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_META_ON                        "smm"
+#define VTE_TERMINFO_VAR_META_ON                        (102 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_NEWLINE                        "nel"
+#define VTE_TERMINFO_VAR_NEWLINE                        (103 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PAD_CHAR                       "pad"
+#define VTE_TERMINFO_VAR_PAD_CHAR                       (104 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_DCH                       "dch"
+#define VTE_TERMINFO_VAR_PARM_DCH                       (105 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_DELETE_LINE               "dl"
+#define VTE_TERMINFO_VAR_PARM_DELETE_LINE               (106 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_DOWN_CURSOR               "cud"
+#define VTE_TERMINFO_VAR_PARM_DOWN_CURSOR               (107 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_ICH                       "ich"
+#define VTE_TERMINFO_VAR_PARM_ICH                       (108 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_INDEX                     "indn"
+#define VTE_TERMINFO_VAR_PARM_INDEX                     (109 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_INSERT_LINE               "il"
+#define VTE_TERMINFO_VAR_PARM_INSERT_LINE               (110 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_LEFT_CURSOR               "cub"
+#define VTE_TERMINFO_VAR_PARM_LEFT_CURSOR               (111 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_RIGHT_CURSOR              "cuf"
+#define VTE_TERMINFO_VAR_PARM_RIGHT_CURSOR              (112 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_RINDEX                    "rin"
+#define VTE_TERMINFO_VAR_PARM_RINDEX                    (113 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_UP_CURSOR                 "cuu"
+#define VTE_TERMINFO_VAR_PARM_UP_CURSOR                 (114 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PKEY_KEY                       "pfkey"
+#define VTE_TERMINFO_VAR_PKEY_KEY                       (115 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PKEY_LOCAL                     "pfloc"
+#define VTE_TERMINFO_VAR_PKEY_LOCAL                     (116 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PKEY_XMIT                      "pfx"
+#define VTE_TERMINFO_VAR_PKEY_XMIT                      (117 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PRINT_SCREEN                   "mc0"
+#define VTE_TERMINFO_VAR_PRINT_SCREEN                   (118 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PRTR_OFF                       "mc4"
+#define VTE_TERMINFO_VAR_PRTR_OFF                       (119 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PRTR_ON                        "mc5"
+#define VTE_TERMINFO_VAR_PRTR_ON                        (120 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_REPEAT_CHAR                    "rep"
+#define VTE_TERMINFO_VAR_REPEAT_CHAR                    (121 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_RESET_1STRING                  "rs1"
+#define VTE_TERMINFO_VAR_RESET_1STRING                  (122 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_RESET_2STRING                  "rs2"
+#define VTE_TERMINFO_VAR_RESET_2STRING                  (123 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_RESET_3STRING                  "rs3"
+#define VTE_TERMINFO_VAR_RESET_3STRING                  (124 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_RESET_FILE                     "rf"
+#define VTE_TERMINFO_VAR_RESET_FILE                     (125 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_RESTORE_CURSOR                 "rc"
+#define VTE_TERMINFO_VAR_RESTORE_CURSOR                 (126 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ROW_ADDRESS                    "vpa"
+#define VTE_TERMINFO_VAR_ROW_ADDRESS                    (127 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SAVE_CURSOR                    "sc"
+#define VTE_TERMINFO_VAR_SAVE_CURSOR                    (128 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SCROLL_FORWARD                 "ind"
+#define VTE_TERMINFO_VAR_SCROLL_FORWARD                 (129 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SCROLL_REVERSE                 "ri"
+#define VTE_TERMINFO_VAR_SCROLL_REVERSE                 (130 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_ATTRIBUTES                 "sgr"
+#define VTE_TERMINFO_VAR_SET_ATTRIBUTES                 (131 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_TAB                        "hts"
+#define VTE_TERMINFO_VAR_SET_TAB                        (132 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_WINDOW                     "wind"
+#define VTE_TERMINFO_VAR_SET_WINDOW                     (133 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_TAB                            "ht"
+#define VTE_TERMINFO_VAR_TAB                            (134 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_TO_STATUS_LINE                 "tsl"
+#define VTE_TERMINFO_VAR_TO_STATUS_LINE                 (135 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_UNDERLINE_CHAR                 "uc"
+#define VTE_TERMINFO_VAR_UNDERLINE_CHAR                 (136 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_UP_HALF_LINE                   "hu"
+#define VTE_TERMINFO_VAR_UP_HALF_LINE                   (137 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INIT_PROG                      "iprog"
+#define VTE_TERMINFO_VAR_INIT_PROG                      (138 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_A1                         "ka1"
+#define VTE_TERMINFO_VAR_KEY_A1                         (139 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_A3                         "ka3"
+#define VTE_TERMINFO_VAR_KEY_A3                         (140 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_B2                         "kb2"
+#define VTE_TERMINFO_VAR_KEY_B2                         (141 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_C1                         "kc1"
+#define VTE_TERMINFO_VAR_KEY_C1                         (142 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_C3                         "kc3"
+#define VTE_TERMINFO_VAR_KEY_C3                         (143 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PRTR_NON                       "mc5p"
+#define VTE_TERMINFO_VAR_PRTR_NON                       (144 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHAR_PADDING                   "rmp"
+#define VTE_TERMINFO_VAR_CHAR_PADDING                   (145 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ACS_CHARS                      "acsc"
+#define VTE_TERMINFO_VAR_ACS_CHARS                      (146 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PLAB_NORM                      "pln"
+#define VTE_TERMINFO_VAR_PLAB_NORM                      (147 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_BTAB                       "kcbt"
+#define VTE_TERMINFO_VAR_KEY_BTAB                       (148 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_XON_MODE                 "smxon"
+#define VTE_TERMINFO_VAR_ENTER_XON_MODE                 (149 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_XON_MODE                  "rmxon"
+#define VTE_TERMINFO_VAR_EXIT_XON_MODE                  (150 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_AM_MODE                  "smam"
+#define VTE_TERMINFO_VAR_ENTER_AM_MODE                  (151 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_AM_MODE                   "rmam"
+#define VTE_TERMINFO_VAR_EXIT_AM_MODE                   (152 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_XON_CHARACTER                  "xonc"
+#define VTE_TERMINFO_VAR_XON_CHARACTER                  (153 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_XOFF_CHARACTER                 "xoffc"
+#define VTE_TERMINFO_VAR_XOFF_CHARACTER                 (154 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENA_ACS                        "enacs"
+#define VTE_TERMINFO_VAR_ENA_ACS                        (155 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LABEL_ON                       "smln"
+#define VTE_TERMINFO_VAR_LABEL_ON                       (156 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LABEL_OFF                      "rmln"
+#define VTE_TERMINFO_VAR_LABEL_OFF                      (157 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_BEG                        "kbeg"
+#define VTE_TERMINFO_VAR_KEY_BEG                        (158 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_CANCEL                     "kcan"
+#define VTE_TERMINFO_VAR_KEY_CANCEL                     (159 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_CLOSE                      "kclo"
+#define VTE_TERMINFO_VAR_KEY_CLOSE                      (160 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_COMMAND                    "kcmd"
+#define VTE_TERMINFO_VAR_KEY_COMMAND                    (161 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_COPY                       "kcpy"
+#define VTE_TERMINFO_VAR_KEY_COPY                       (162 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_CREATE                     "kcrt"
+#define VTE_TERMINFO_VAR_KEY_CREATE                     (163 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_END                        "kend"
+#define VTE_TERMINFO_VAR_KEY_END                        (164 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_ENTER                      "kent"
+#define VTE_TERMINFO_VAR_KEY_ENTER                      (165 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_EXIT                       "kext"
+#define VTE_TERMINFO_VAR_KEY_EXIT                       (166 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_FIND                       "kfnd"
+#define VTE_TERMINFO_VAR_KEY_FIND                       (167 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_HELP                       "khlp"
+#define VTE_TERMINFO_VAR_KEY_HELP                       (168 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_MARK                       "kmrk"
+#define VTE_TERMINFO_VAR_KEY_MARK                       (169 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_MESSAGE                    "kmsg"
+#define VTE_TERMINFO_VAR_KEY_MESSAGE                    (170 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_MOVE                       "kmov"
+#define VTE_TERMINFO_VAR_KEY_MOVE                       (171 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_NEXT                       "knxt"
+#define VTE_TERMINFO_VAR_KEY_NEXT                       (172 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_OPEN                       "kopn"
+#define VTE_TERMINFO_VAR_KEY_OPEN                       (173 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_OPTIONS                    "kopt"
+#define VTE_TERMINFO_VAR_KEY_OPTIONS                    (174 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_PREVIOUS                   "kprv"
+#define VTE_TERMINFO_VAR_KEY_PREVIOUS                   (175 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_PRINT                      "kprt"
+#define VTE_TERMINFO_VAR_KEY_PRINT                      (176 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_REDO                       "krdo"
+#define VTE_TERMINFO_VAR_KEY_REDO                       (177 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_REFERENCE                  "kref"
+#define VTE_TERMINFO_VAR_KEY_REFERENCE                  (178 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_REFRESH                    "krfr"
+#define VTE_TERMINFO_VAR_KEY_REFRESH                    (179 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_REPLACE                    "krpl"
+#define VTE_TERMINFO_VAR_KEY_REPLACE                    (180 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_RESTART                    "krst"
+#define VTE_TERMINFO_VAR_KEY_RESTART                    (181 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_RESUME                     "kres"
+#define VTE_TERMINFO_VAR_KEY_RESUME                     (182 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SAVE                       "ksav"
+#define VTE_TERMINFO_VAR_KEY_SAVE                       (183 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SUSPEND                    "kspd"
+#define VTE_TERMINFO_VAR_KEY_SUSPEND                    (184 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_UNDO                       "kund"
+#define VTE_TERMINFO_VAR_KEY_UNDO                       (185 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SBEG                       "kBEG"
+#define VTE_TERMINFO_VAR_KEY_SBEG                       (186 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SCANCEL                    "kCAN"
+#define VTE_TERMINFO_VAR_KEY_SCANCEL                    (187 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SCOMMAND                   "kCMD"
+#define VTE_TERMINFO_VAR_KEY_SCOMMAND                   (188 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SCOPY                      "kCPY"
+#define VTE_TERMINFO_VAR_KEY_SCOPY                      (189 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SCREATE                    "kCRT"
+#define VTE_TERMINFO_VAR_KEY_SCREATE                    (190 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SDC                        "kDC"
+#define VTE_TERMINFO_VAR_KEY_SDC                        (191 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SDL                        "kDL"
+#define VTE_TERMINFO_VAR_KEY_SDL                        (192 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SELECT                     "kslt"
+#define VTE_TERMINFO_VAR_KEY_SELECT                     (193 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SEND                       "kEND"
+#define VTE_TERMINFO_VAR_KEY_SEND                       (194 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SEOL                       "kEOL"
+#define VTE_TERMINFO_VAR_KEY_SEOL                       (195 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SEXIT                      "kEXT"
+#define VTE_TERMINFO_VAR_KEY_SEXIT                      (196 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SFIND                      "kFND"
+#define VTE_TERMINFO_VAR_KEY_SFIND                      (197 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SHELP                      "kHLP"
+#define VTE_TERMINFO_VAR_KEY_SHELP                      (198 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SHOME                      "kHOM"
+#define VTE_TERMINFO_VAR_KEY_SHOME                      (199 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SIC                        "kIC"
+#define VTE_TERMINFO_VAR_KEY_SIC                        (200 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SLEFT                      "kLFT"
+#define VTE_TERMINFO_VAR_KEY_SLEFT                      (201 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SMESSAGE                   "kMSG"
+#define VTE_TERMINFO_VAR_KEY_SMESSAGE                   (202 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SMOVE                      "kMOV"
+#define VTE_TERMINFO_VAR_KEY_SMOVE                      (203 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SNEXT                      "kNXT"
+#define VTE_TERMINFO_VAR_KEY_SNEXT                      (204 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SOPTIONS                   "kOPT"
+#define VTE_TERMINFO_VAR_KEY_SOPTIONS                   (205 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SPREVIOUS                  "kPRV"
+#define VTE_TERMINFO_VAR_KEY_SPREVIOUS                  (206 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SPRINT                     "kPRT"
+#define VTE_TERMINFO_VAR_KEY_SPRINT                     (207 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SREDO                      "kRDO"
+#define VTE_TERMINFO_VAR_KEY_SREDO                      (208 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SREPLACE                   "kRPL"
+#define VTE_TERMINFO_VAR_KEY_SREPLACE                   (209 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SRIGHT                     "kRIT"
+#define VTE_TERMINFO_VAR_KEY_SRIGHT                     (210 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SRSUME                     "kRES"
+#define VTE_TERMINFO_VAR_KEY_SRSUME                     (211 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SSAVE                      "kSAV"
+#define VTE_TERMINFO_VAR_KEY_SSAVE                      (212 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SSUSPEND                   "kSPD"
+#define VTE_TERMINFO_VAR_KEY_SSUSPEND                   (213 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_SUNDO                      "kUND"
+#define VTE_TERMINFO_VAR_KEY_SUNDO                      (214 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_REQ_FOR_INPUT                  "rfi"
+#define VTE_TERMINFO_VAR_REQ_FOR_INPUT                  (215 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F11                        "kf11"
+#define VTE_TERMINFO_VAR_KEY_F11                        (216 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F12                        "kf12"
+#define VTE_TERMINFO_VAR_KEY_F12                        (217 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F13                        "kf13"
+#define VTE_TERMINFO_VAR_KEY_F13                        (218 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F14                        "kf14"
+#define VTE_TERMINFO_VAR_KEY_F14                        (219 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F15                        "kf15"
+#define VTE_TERMINFO_VAR_KEY_F15                        (220 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F16                        "kf16"
+#define VTE_TERMINFO_VAR_KEY_F16                        (221 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F17                        "kf17"
+#define VTE_TERMINFO_VAR_KEY_F17                        (222 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F18                        "kf18"
+#define VTE_TERMINFO_VAR_KEY_F18                        (223 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F19                        "kf19"
+#define VTE_TERMINFO_VAR_KEY_F19                        (224 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F20                        "kf20"
+#define VTE_TERMINFO_VAR_KEY_F20                        (225 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F21                        "kf21"
+#define VTE_TERMINFO_VAR_KEY_F21                        (226 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F22                        "kf22"
+#define VTE_TERMINFO_VAR_KEY_F22                        (227 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F23                        "kf23"
+#define VTE_TERMINFO_VAR_KEY_F23                        (228 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F24                        "kf24"
+#define VTE_TERMINFO_VAR_KEY_F24                        (229 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F25                        "kf25"
+#define VTE_TERMINFO_VAR_KEY_F25                        (230 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F26                        "kf26"
+#define VTE_TERMINFO_VAR_KEY_F26                        (231 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F27                        "kf27"
+#define VTE_TERMINFO_VAR_KEY_F27                        (232 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F28                        "kf28"
+#define VTE_TERMINFO_VAR_KEY_F28                        (233 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F29                        "kf29"
+#define VTE_TERMINFO_VAR_KEY_F29                        (234 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F30                        "kf30"
+#define VTE_TERMINFO_VAR_KEY_F30                        (235 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F31                        "kf31"
+#define VTE_TERMINFO_VAR_KEY_F31                        (236 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F32                        "kf32"
+#define VTE_TERMINFO_VAR_KEY_F32                        (237 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F33                        "kf33"
+#define VTE_TERMINFO_VAR_KEY_F33                        (238 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F34                        "kf34"
+#define VTE_TERMINFO_VAR_KEY_F34                        (239 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F35                        "kf35"
+#define VTE_TERMINFO_VAR_KEY_F35                        (240 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F36                        "kf36"
+#define VTE_TERMINFO_VAR_KEY_F36                        (241 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F37                        "kf37"
+#define VTE_TERMINFO_VAR_KEY_F37                        (242 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F38                        "kf38"
+#define VTE_TERMINFO_VAR_KEY_F38                        (243 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F39                        "kf39"
+#define VTE_TERMINFO_VAR_KEY_F39                        (244 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F40                        "kf40"
+#define VTE_TERMINFO_VAR_KEY_F40                        (245 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F41                        "kf41"
+#define VTE_TERMINFO_VAR_KEY_F41                        (246 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F42                        "kf42"
+#define VTE_TERMINFO_VAR_KEY_F42                        (247 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F43                        "kf43"
+#define VTE_TERMINFO_VAR_KEY_F43                        (248 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F44                        "kf44"
+#define VTE_TERMINFO_VAR_KEY_F44                        (249 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F45                        "kf45"
+#define VTE_TERMINFO_VAR_KEY_F45                        (250 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F46                        "kf46"
+#define VTE_TERMINFO_VAR_KEY_F46                        (251 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F47                        "kf47"
+#define VTE_TERMINFO_VAR_KEY_F47                        (252 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F48                        "kf48"
+#define VTE_TERMINFO_VAR_KEY_F48                        (253 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F49                        "kf49"
+#define VTE_TERMINFO_VAR_KEY_F49                        (254 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F50                        "kf50"
+#define VTE_TERMINFO_VAR_KEY_F50                        (255 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F51                        "kf51"
+#define VTE_TERMINFO_VAR_KEY_F51                        (256 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F52                        "kf52"
+#define VTE_TERMINFO_VAR_KEY_F52                        (257 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F53                        "kf53"
+#define VTE_TERMINFO_VAR_KEY_F53                        (258 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F54                        "kf54"
+#define VTE_TERMINFO_VAR_KEY_F54                        (259 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F55                        "kf55"
+#define VTE_TERMINFO_VAR_KEY_F55                        (260 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F56                        "kf56"
+#define VTE_TERMINFO_VAR_KEY_F56                        (261 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F57                        "kf57"
+#define VTE_TERMINFO_VAR_KEY_F57                        (262 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F58                        "kf58"
+#define VTE_TERMINFO_VAR_KEY_F58                        (263 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F59                        "kf59"
+#define VTE_TERMINFO_VAR_KEY_F59                        (264 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F60                        "kf60"
+#define VTE_TERMINFO_VAR_KEY_F60                        (265 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F61                        "kf61"
+#define VTE_TERMINFO_VAR_KEY_F61                        (266 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F62                        "kf62"
+#define VTE_TERMINFO_VAR_KEY_F62                        (267 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_F63                        "kf63"
+#define VTE_TERMINFO_VAR_KEY_F63                        (268 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CLR_BOL                        "el1"
+#define VTE_TERMINFO_VAR_CLR_BOL                        (269 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CLEAR_MARGINS                  "mgc"
+#define VTE_TERMINFO_VAR_CLEAR_MARGINS                  (270 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_LEFT_MARGIN                "smgl"
+#define VTE_TERMINFO_VAR_SET_LEFT_MARGIN                (271 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_RIGHT_MARGIN               "smgr"
+#define VTE_TERMINFO_VAR_SET_RIGHT_MARGIN               (272 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_LABEL_FORMAT                   "fln"
+#define VTE_TERMINFO_VAR_LABEL_FORMAT                   (273 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_CLOCK                      "sclk"
+#define VTE_TERMINFO_VAR_SET_CLOCK                      (274 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DISPLAY_CLOCK                  "dclk"
+#define VTE_TERMINFO_VAR_DISPLAY_CLOCK                  (275 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_REMOVE_CLOCK                   "rmclk"
+#define VTE_TERMINFO_VAR_REMOVE_CLOCK                   (276 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CREATE_WINDOW                  "cwin"
+#define VTE_TERMINFO_VAR_CREATE_WINDOW                  (277 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_GOTO_WINDOW                    "wingo"
+#define VTE_TERMINFO_VAR_GOTO_WINDOW                    (278 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_HANGUP                         "hup"
+#define VTE_TERMINFO_VAR_HANGUP                         (279 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DIAL_PHONE                     "dial"
+#define VTE_TERMINFO_VAR_DIAL_PHONE                     (280 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_QUICK_DIAL                     "qdial"
+#define VTE_TERMINFO_VAR_QUICK_DIAL                     (281 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_TONE                           "tone"
+#define VTE_TERMINFO_VAR_TONE                           (282 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PULSE                          "pulse"
+#define VTE_TERMINFO_VAR_PULSE                          (283 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_FLASH_HOOK                     "hook"
+#define VTE_TERMINFO_VAR_FLASH_HOOK                     (284 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_FIXED_PAUSE                    "pause"
+#define VTE_TERMINFO_VAR_FIXED_PAUSE                    (285 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_WAIT_TONE                      "wait"
+#define VTE_TERMINFO_VAR_WAIT_TONE                      (286 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER0                          "u0"
+#define VTE_TERMINFO_VAR_USER0                          (287 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER1                          "u1"
+#define VTE_TERMINFO_VAR_USER1                          (288 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER2                          "u2"
+#define VTE_TERMINFO_VAR_USER2                          (289 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER3                          "u3"
+#define VTE_TERMINFO_VAR_USER3                          (290 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER4                          "u4"
+#define VTE_TERMINFO_VAR_USER4                          (291 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER5                          "u5"
+#define VTE_TERMINFO_VAR_USER5                          (292 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER6                          "u6"
+#define VTE_TERMINFO_VAR_USER6                          (293 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER7                          "u7"
+#define VTE_TERMINFO_VAR_USER7                          (294 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER8                          "u8"
+#define VTE_TERMINFO_VAR_USER8                          (295 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_USER9                          "u9"
+#define VTE_TERMINFO_VAR_USER9                          (296 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ORIG_PAIR                      "op"
+#define VTE_TERMINFO_VAR_ORIG_PAIR                      (297 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ORIG_COLORS                    "oc"
+#define VTE_TERMINFO_VAR_ORIG_COLORS                    (298 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INITIALIZE_COLOR               "initc"
+#define VTE_TERMINFO_VAR_INITIALIZE_COLOR               (299 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_INITIALIZE_PAIR                "initp"
+#define VTE_TERMINFO_VAR_INITIALIZE_PAIR                (300 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_COLOR_PAIR                 "scp"
+#define VTE_TERMINFO_VAR_SET_COLOR_PAIR                 (301 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_FOREGROUND                 "setf"
+#define VTE_TERMINFO_VAR_SET_FOREGROUND                 (302 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_BACKGROUND                 "setb"
+#define VTE_TERMINFO_VAR_SET_BACKGROUND                 (303 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHANGE_CHAR_PITCH              "cpi"
+#define VTE_TERMINFO_VAR_CHANGE_CHAR_PITCH              (304 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHANGE_LINE_PITCH              "lpi"
+#define VTE_TERMINFO_VAR_CHANGE_LINE_PITCH              (305 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHANGE_RES_HORZ                "chr"
+#define VTE_TERMINFO_VAR_CHANGE_RES_HORZ                (306 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHANGE_RES_VERT                "cvr"
+#define VTE_TERMINFO_VAR_CHANGE_RES_VERT                (307 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DEFINE_CHAR                    "defc"
+#define VTE_TERMINFO_VAR_DEFINE_CHAR                    (308 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_DOUBLEWIDE_MODE          "swidm"
+#define VTE_TERMINFO_VAR_ENTER_DOUBLEWIDE_MODE          (309 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_DRAFT_QUALITY            "sdrfq"
+#define VTE_TERMINFO_VAR_ENTER_DRAFT_QUALITY            (310 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_ITALICS_MODE             "sitm"
+#define VTE_TERMINFO_VAR_ENTER_ITALICS_MODE             (311 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_LEFTWARD_MODE            "slm"
+#define VTE_TERMINFO_VAR_ENTER_LEFTWARD_MODE            (312 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_MICRO_MODE               "smicm"
+#define VTE_TERMINFO_VAR_ENTER_MICRO_MODE               (313 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_NEAR_LETTER_QUALITY      "snlq"
+#define VTE_TERMINFO_VAR_ENTER_NEAR_LETTER_QUALITY      (314 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_NORMAL_QUALITY           "snrmq"
+#define VTE_TERMINFO_VAR_ENTER_NORMAL_QUALITY           (315 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_SHADOW_MODE              "sshm"
+#define VTE_TERMINFO_VAR_ENTER_SHADOW_MODE              (316 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_SUBSCRIPT_MODE           "ssubm"
+#define VTE_TERMINFO_VAR_ENTER_SUBSCRIPT_MODE           (317 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_SUPERSCRIPT_MODE         "ssupm"
+#define VTE_TERMINFO_VAR_ENTER_SUPERSCRIPT_MODE         (318 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_UPWARD_MODE              "sum"
+#define VTE_TERMINFO_VAR_ENTER_UPWARD_MODE              (319 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_DOUBLEWIDE_MODE           "rwidm"
+#define VTE_TERMINFO_VAR_EXIT_DOUBLEWIDE_MODE           (320 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_ITALICS_MODE              "ritm"
+#define VTE_TERMINFO_VAR_EXIT_ITALICS_MODE              (321 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_LEFTWARD_MODE             "rlm"
+#define VTE_TERMINFO_VAR_EXIT_LEFTWARD_MODE             (322 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_MICRO_MODE                "rmicm"
+#define VTE_TERMINFO_VAR_EXIT_MICRO_MODE                (323 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_SHADOW_MODE               "rshm"
+#define VTE_TERMINFO_VAR_EXIT_SHADOW_MODE               (324 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_SUBSCRIPT_MODE            "rsubm"
+#define VTE_TERMINFO_VAR_EXIT_SUBSCRIPT_MODE            (325 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_SUPERSCRIPT_MODE          "rsupm"
+#define VTE_TERMINFO_VAR_EXIT_SUPERSCRIPT_MODE          (326 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_UPWARD_MODE               "rum"
+#define VTE_TERMINFO_VAR_EXIT_UPWARD_MODE               (327 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MICRO_COLUMN_ADDRESS           "mhpa"
+#define VTE_TERMINFO_VAR_MICRO_COLUMN_ADDRESS           (328 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MICRO_DOWN                     "mcud1"
+#define VTE_TERMINFO_VAR_MICRO_DOWN                     (329 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MICRO_LEFT                     "mcub1"
+#define VTE_TERMINFO_VAR_MICRO_LEFT                     (330 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MICRO_RIGHT                    "mcuf1"
+#define VTE_TERMINFO_VAR_MICRO_RIGHT                    (331 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MICRO_ROW_ADDRESS              "mvpa"
+#define VTE_TERMINFO_VAR_MICRO_ROW_ADDRESS              (332 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MICRO_UP                       "mcuu1"
+#define VTE_TERMINFO_VAR_MICRO_UP                       (333 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ORDER_OF_PINS                  "porder"
+#define VTE_TERMINFO_VAR_ORDER_OF_PINS                  (334 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_DOWN_MICRO                "mcud"
+#define VTE_TERMINFO_VAR_PARM_DOWN_MICRO                (335 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_LEFT_MICRO                "mcub"
+#define VTE_TERMINFO_VAR_PARM_LEFT_MICRO                (336 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_RIGHT_MICRO               "mcuf"
+#define VTE_TERMINFO_VAR_PARM_RIGHT_MICRO               (337 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PARM_UP_MICRO                  "mcuu"
+#define VTE_TERMINFO_VAR_PARM_UP_MICRO                  (338 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SELECT_CHAR_SET                "scs"
+#define VTE_TERMINFO_VAR_SELECT_CHAR_SET                (339 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_BOTTOM_MARGIN              "smgb"
+#define VTE_TERMINFO_VAR_SET_BOTTOM_MARGIN              (340 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_BOTTOM_MARGIN_PARM         "smgbp"
+#define VTE_TERMINFO_VAR_SET_BOTTOM_MARGIN_PARM         (341 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_LEFT_MARGIN_PARM           "smglp"
+#define VTE_TERMINFO_VAR_SET_LEFT_MARGIN_PARM           (342 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_RIGHT_MARGIN_PARM          "smgrp"
+#define VTE_TERMINFO_VAR_SET_RIGHT_MARGIN_PARM          (343 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_TOP_MARGIN                 "smgt"
+#define VTE_TERMINFO_VAR_SET_TOP_MARGIN                 (344 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_TOP_MARGIN_PARM            "smgtp"
+#define VTE_TERMINFO_VAR_SET_TOP_MARGIN_PARM            (345 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_START_BIT_IMAGE                "sbim"
+#define VTE_TERMINFO_VAR_START_BIT_IMAGE                (346 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_START_CHAR_SET_DEF             "scsd"
+#define VTE_TERMINFO_VAR_START_CHAR_SET_DEF             (347 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_STOP_BIT_IMAGE                 "rbim"
+#define VTE_TERMINFO_VAR_STOP_BIT_IMAGE                 (348 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_STOP_CHAR_SET_DEF              "rcsd"
+#define VTE_TERMINFO_VAR_STOP_CHAR_SET_DEF              (349 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SUBSCRIPT_CHARACTERS           "subcs"
+#define VTE_TERMINFO_VAR_SUBSCRIPT_CHARACTERS           (350 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SUPERSCRIPT_CHARACTERS         "supcs"
+#define VTE_TERMINFO_VAR_SUPERSCRIPT_CHARACTERS         (351 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_THESE_CAUSE_CR                 "docr"
+#define VTE_TERMINFO_VAR_THESE_CAUSE_CR                 (352 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ZERO_MOTION                    "zerom"
+#define VTE_TERMINFO_VAR_ZERO_MOTION                    (353 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CHAR_SET_NAMES                 "csnm"
+#define VTE_TERMINFO_VAR_CHAR_SET_NAMES                 (354 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_KEY_MOUSE                      "kmous"
+#define VTE_TERMINFO_VAR_KEY_MOUSE                      (355 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_MOUSE_INFO                     "minfo"
+#define VTE_TERMINFO_VAR_MOUSE_INFO                     (356 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_REQ_MOUSE_POS                  "reqmp"
+#define VTE_TERMINFO_VAR_REQ_MOUSE_POS                  (357 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_GET_MOUSE                      "getm"
+#define VTE_TERMINFO_VAR_GET_MOUSE                      (358 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_A_FOREGROUND               "setaf"
+#define VTE_TERMINFO_VAR_SET_A_FOREGROUND               (359 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_A_BACKGROUND               "setab"
+#define VTE_TERMINFO_VAR_SET_A_BACKGROUND               (360 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PKEY_PLAB                      "pfxl"
+#define VTE_TERMINFO_VAR_PKEY_PLAB                      (361 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DEVICE_TYPE                    "devt"
+#define VTE_TERMINFO_VAR_DEVICE_TYPE                    (362 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_CODE_SET_INIT                  "csin"
+#define VTE_TERMINFO_VAR_CODE_SET_INIT                  (363 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET0_DES_SEQ                   "s0ds"
+#define VTE_TERMINFO_VAR_SET0_DES_SEQ                   (364 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET1_DES_SEQ                   "s1ds"
+#define VTE_TERMINFO_VAR_SET1_DES_SEQ                   (365 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET2_DES_SEQ                   "s2ds"
+#define VTE_TERMINFO_VAR_SET2_DES_SEQ                   (366 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET3_DES_SEQ                   "s3ds"
+#define VTE_TERMINFO_VAR_SET3_DES_SEQ                   (367 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_LR_MARGIN                  "smglr"
+#define VTE_TERMINFO_VAR_SET_LR_MARGIN                  (368 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_TB_MARGIN                  "smgtb"
+#define VTE_TERMINFO_VAR_SET_TB_MARGIN                  (369 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_BIT_IMAGE_REPEAT               "birep"
+#define VTE_TERMINFO_VAR_BIT_IMAGE_REPEAT               (370 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_BIT_IMAGE_NEWLINE              "binel"
+#define VTE_TERMINFO_VAR_BIT_IMAGE_NEWLINE              (371 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_BIT_IMAGE_CARRIAGE_RETURN      "bicr"
+#define VTE_TERMINFO_VAR_BIT_IMAGE_CARRIAGE_RETURN      (372 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_COLOR_NAMES                    "colornm"
+#define VTE_TERMINFO_VAR_COLOR_NAMES                    (373 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DEFINE_BIT_IMAGE_REGION        "defbi"
+#define VTE_TERMINFO_VAR_DEFINE_BIT_IMAGE_REGION        (374 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_END_BIT_IMAGE_REGION           "endbi"
+#define VTE_TERMINFO_VAR_END_BIT_IMAGE_REGION           (375 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_COLOR_BAND                 "setcolor"
+#define VTE_TERMINFO_VAR_SET_COLOR_BAND                 (376 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_PAGE_LENGTH                "slines"
+#define VTE_TERMINFO_VAR_SET_PAGE_LENGTH                (377 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_DISPLAY_PC_CHAR                "dispc"
+#define VTE_TERMINFO_VAR_DISPLAY_PC_CHAR                (378 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_PC_CHARSET_MODE          "smpch"
+#define VTE_TERMINFO_VAR_ENTER_PC_CHARSET_MODE          (379 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_PC_CHARSET_MODE           "rmpch"
+#define VTE_TERMINFO_VAR_EXIT_PC_CHARSET_MODE           (380 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_SCANCODE_MODE            "smsc"
+#define VTE_TERMINFO_VAR_ENTER_SCANCODE_MODE            (381 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_EXIT_SCANCODE_MODE             "rmsc"
+#define VTE_TERMINFO_VAR_EXIT_SCANCODE_MODE             (382 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_PC_TERM_OPTIONS                "pctrm"
+#define VTE_TERMINFO_VAR_PC_TERM_OPTIONS                (383 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SCANCODE_ESCAPE                "scesc"
+#define VTE_TERMINFO_VAR_SCANCODE_ESCAPE                (384 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ALT_SCANCODE_ESC               "scesa"
+#define VTE_TERMINFO_VAR_ALT_SCANCODE_ESC               (385 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_HORIZONTAL_HL_MODE       "ehhlm"
+#define VTE_TERMINFO_VAR_ENTER_HORIZONTAL_HL_MODE       (386 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_LEFT_HL_MODE             "elhlm"
+#define VTE_TERMINFO_VAR_ENTER_LEFT_HL_MODE             (387 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_LOW_HL_MODE              "elohlm"
+#define VTE_TERMINFO_VAR_ENTER_LOW_HL_MODE              (388 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_RIGHT_HL_MODE            "erhlm"
+#define VTE_TERMINFO_VAR_ENTER_RIGHT_HL_MODE            (389 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_TOP_HL_MODE              "ethlm"
+#define VTE_TERMINFO_VAR_ENTER_TOP_HL_MODE              (390 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_ENTER_VERTICAL_HL_MODE         "evhlm"
+#define VTE_TERMINFO_VAR_ENTER_VERTICAL_HL_MODE         (391 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_A_ATTRIBUTES               "sgr1"
+#define VTE_TERMINFO_VAR_SET_A_ATTRIBUTES               (392 | VTE_TERMINFO_VARTYPE_STRING)
+#define VTE_TERMINFO_CAP_SET_PGLEN_INCH                 "slength"
+#define VTE_TERMINFO_VAR_SET_PGLEN_INCH                 (393 | VTE_TERMINFO_VARTYPE_STRING)
+
+
+#endif /* __VTE_TERMINFO_VARS_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]