[vte] emulation: No longer rely on terminfo; drop ncurses dependency



commit 4e253be9282829f594c8a55ca08d1299e80e471d
Author: Egmont Koblinger <egmont gmail com>
Date:   Tue May 20 11:23:56 2014 +0200

    emulation: No longer rely on terminfo; drop ncurses dependency
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728900#c5

 HACKING                        |    9 +-
 README                         |    3 -
 configure.ac                   |   12 +-
 doc/reference/vte-sections.txt |    3 -
 src/Makefile.am                |   71 +---
 src/app.vala                   |    5 -
 src/debug.c                    |   42 ++
 src/debug.h                    |    1 +
 src/interpret.c                |   20 +-
 src/keymap.c                   |    2 +-
 src/keymap.h                   |    2 -
 src/matcher.c                  |  154 ++-----
 src/matcher.h                  |    3 +-
 src/pty.c                      |   70 +---
 src/table.c                    |    2 +-
 src/vte-private.h              |    1 -
 src/vte.c                      |  176 +-------
 src/vteglobals.h               |    2 -
 src/vtepty.h                   |    3 -
 src/vteseq.c                   |    9 -
 src/vteterminal.h              |    6 -
 src/vteti.c                    |  628 --------------------------
 src/vteti.h                    |   94 ----
 src/vtetivars.awk              |   83 ----
 src/vtetivars.h                |  966 ----------------------------------------
 25 files changed, 112 insertions(+), 2255 deletions(-)
---
diff --git a/HACKING b/HACKING
index b399c0e..6abc67a 100644
--- a/HACKING
+++ b/HACKING
@@ -3,16 +3,9 @@ cleaning it as fast as possible and aiming for a 1.0 release "next year".
 Please contact people listed in filed MAINTAINERS if you intend to hack
 on it, especially if you want to commit stuff.
 
-Vte is different from other terminal emulators in that instead of hard
-coding behavior of a few select terminals, it can emulate any terminal
-simply by reading its terminfo capabilities file.  The idea being that
-if applications can communicate with any terminal by reading its
-capabilities, the emulation widget can also behave like any terminal by
-reading that file.  Well, that's just the idea :).
-
 This is the most useful resource in understanding various internal states
 as well as control sequences:
 
        http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
 
-And to understand termcap, terminfo, etc, "make terminfo" is a great start.
+And to understand termcap, terminfo, etc, "man 5 terminfo" is a great start.
diff --git a/README b/README
index 190ef57..b6c9b7d 100644
--- a/README
+++ b/README
@@ -5,9 +5,6 @@ and a minimal sample application (vte) using that.  Vte is mainly used in
 gnome-terminal, but can also be used to embed a console/terminal in games,
 editors, IDEs, etc.
 
-VTE supports Unicode and character set conversion, as well as emulating any
-terminal known to the system's terminfo database.
-
 VTE doesn't have a homepage.  Report any issues at:
 
   http://bugzilla.gnome.org/enter_bug.cgi?product=vte
diff --git a/configure.ac b/configure.ac
index 40d06af..de4aa8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,8 +172,8 @@ AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK multihead-safe APIs.])
 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
 
-VTE_DEFAULT_EMULATION=xterm
-AC_DEFINE_UNQUOTED(VTE_DEFAULT_EMULATION,"$VTE_DEFAULT_EMULATION",[The default terminal type to be 
emulated.])
+VTE_DEFAULT_TERM=xterm
+AC_DEFINE_UNQUOTED(VTE_DEFAULT_TERM,"$VTE_DEFAULT_TERM",[The default value $TERM is set to.])
 
 # Check for headers.
 AC_CHECK_HEADERS(sys/select.h sys/syslimits.h sys/termios.h sys/un.h sys/wait.h stropts.h termios.h util.h 
wchar.h)
@@ -212,18 +212,10 @@ VTE_PKGS="glib-2.0 >= $GLIB_REQUIRED gobject-2.0 pango >= $PANGO_REQUIRED gtk+-$
 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/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 7068d4f..48bdfa8 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -66,8 +66,6 @@ vte_terminal_match_set_cursor_type
 vte_terminal_match_set_cursor_name
 vte_terminal_set_cjk_ambiguous_width
 vte_terminal_get_cjk_ambiguous_width
-vte_terminal_set_emulation
-vte_terminal_get_emulation
 vte_terminal_set_encoding
 vte_terminal_get_encoding
 vte_terminal_write_contents
@@ -79,7 +77,6 @@ vte_terminal_search_set_gregex
 vte_terminal_search_set_wrap_around
 
 <SUBSECTION>
-vte_get_default_emulation
 vte_get_user_shell
 
 <SUBSECTION>
diff --git a/src/Makefile.am b/src/Makefile.am
index 57d7204..220f1be 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,8 +37,6 @@ EXTRA_libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_SOURCES = \
        unitable.JIS0208 \
        unitable.JIS0212 \
        unitable.KSX1001 \
-       vteseq-2.gperf \
-       vteseq-2.c \
        vteseq-n.gperf \
        vteseq-n.c \
        vtetypebuiltins.c.template \
@@ -88,9 +86,6 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_SOURCES = \
        vtestream-base.h \
        vtestream-file.h \
        vteterminal.h \
-       vteti.c \
-       vteti.h \
-       vtetivars.h \
        vtetree.c \
        vtetree.h \
        vteunistr.c \
@@ -121,7 +116,6 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_CPPFLAGS = \
 
 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 = \
@@ -131,15 +125,14 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LDFLAGS = \
        $(AM_LDFLAGS)
 
 libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LIBADD = \
-       $(VTE_LIBS) \
-       $(TERMINFO_LIBS)
+       $(VTE_LIBS)
 
 # Generated sources
 
-VTESEQ_BUILTSOURCES = vteseq-list.h vteseq-2.c vteseq-n.c
+VTESEQ_BUILTSOURCES = vteseq-list.h 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 box_drawing_generate.sh iso2022.txt vtetivars.awk
+EXTRA_DIST += $(VTESEQ_BUILTSOURCES) box_drawing.txt box_drawing_generate.sh iso2022.txt
 CLEANFILES += box_drawing.h marshal.c marshal.h vtetypebuiltins.c vtetypebuiltins.h stamp-vtetypebuiltins.h 
vteresources.c
 
 box_drawing.h: box_drawing.txt
@@ -164,15 +157,11 @@ vtetypebuiltins.c: vtetypebuiltins.c.template vteenums.h
        && (cmp -s xgen-vtbc vtetypebuiltins.c || cp xgen-vtbc vtetypebuiltins.c ) \
        && rm -f xgen-vtbc
 
-vteseq-2.c: vteseq-2.gperf
-       $(AM_V_GEN) $(top_srcdir)/missing --run gperf -m 100 --no-strlen $< > $  tmp && \
-       mv -f $  tmp $@
-
 vteseq-n.c: vteseq-n.gperf
        $(AM_V_GEN) $(top_srcdir)/missing --run gperf -m 100 $< > $  tmp && \
        mv -f $  tmp $@
 
-vteseq-list.h: vteseq-2.gperf vteseq-n.gperf
+vteseq-list.h: vteseq-n.gperf
        $(AM_V_GEN) echo '/* Generated file.  Do not edit */' > $  tmp && \
        cat $^ | grep -v '^#' | grep '\<VTE_SEQUENCE_HANDLER\>'| sed 's/.*, //' | LANG=C sort -u >> $  tmp && 
\
        mv -f $  tmp $@
@@ -180,10 +169,6 @@ 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 gawk -f $< Caps > $  tmp && \
-       mv -f $  tmp $@
-
 # introspection
 
 INTROSPECTION_GIRS =
@@ -320,7 +305,7 @@ TEST_SH = \
        $(NULL)
 EXTRA_DIST += $(TEST_SH)
 
-check_PROGRAMS = dumpkeys iso2022 reflect-text-view reflect-vte mev table trie xticker vteconv vteti
+check_PROGRAMS = dumpkeys iso2022 reflect-text-view reflect-vte mev table trie xticker vteconv
 TESTS = table trie vteconv $(TEST_SH)
 
 reflect_text_view_CPPFLAGS = -DUSE_TEXT_VIEW $(AM_CPPFLAGS)
@@ -349,9 +334,6 @@ interpret_SOURCES = \
        trie.h \
        vteconv.c \
        vteconv.h \
-       vteti.c \
-       vteti.h \
-       vtetivars.h \
        vtetree.c \
        vtetree.h \
        interpret.c
@@ -363,12 +345,10 @@ interpret_CFLAGS = \
        $(GLIB_CFLAGS) \
        $(GOBJECT_CFLAGS) \
        $(GTK_CFLAGS) \
-       $(TERMINFO_CFLAGS) \
        $(AM_CFLAGS)
 interpret_LDADD = \
        $(GLIB_LIBS) \
-       $(GOBJECT_LIBS) \
-       $(TERMINFO_LIBS)
+       $(GOBJECT_LIBS)
 
 iso2022_SOURCES = \
        buffer.h \
@@ -386,9 +366,6 @@ iso2022_SOURCES = \
        trie.h \
        vteconv.c \
        vteconv.h \
-       vteti.c \
-       vteti.h \
-       vtetivars.h \
        vtetree.c \
        vtetree.h
 iso2022_CPPFLAGS = \
@@ -397,12 +374,10 @@ iso2022_CPPFLAGS = \
 iso2022_CFLAGS = \
        $(GLIB_CFLAGS) \
        $(GTK_CFLAGS) \
-       $(TERMINFO_CFLAGS) \
        $(AM_CFLAGS)
 iso2022_LDADD = \
        $(GLIB_LIBS) \
-       $(GOBJECT_LIBS) \
-       $(TERMINFO_LIBS)
+       $(GOBJECT_LIBS)
 
 slowcat_SOURCES = \
        slowcat.c \
@@ -424,21 +399,16 @@ table_SOURCES = \
        trie.h \
        vteconv.c \
        vteconv.h \
-       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)
+       $(GOBJECT_LIBS)
 
 trie_SOURCES = \
        trie.c \
@@ -454,9 +424,6 @@ trie_SOURCES = \
        table.h \
        vteconv.c \
        vteconv.h \
-       vteti.c \
-       vteti.h \
-       vtetivars.h \
        $(NULL)
 trie_CPPFLAGS = \
        -DTRIE_MAIN \
@@ -464,30 +431,10 @@ trie_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)
+       $(GOBJECT_LIBS)
 
 vteconv_SOURCES = buffer.h debug.c debug.h vteconv.c vteconv.h
 vteconv_CPPFLAGS = -DVTECONV_MAIN $(AM_CPPFLAGS)
diff --git a/src/app.vala b/src/app.vala
index 9e15667..2f03706 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -106,8 +106,6 @@ class Window : Gtk.ApplicationWindow
     if (App.Options.no_double_buffer)
       terminal.set_double_buffered(true);
 
-    if (App.Options.term != null)
-      terminal.set_emulation(App.Options.term);
     if (App.Options.encoding != null)
       terminal.set_encoding(App.Options.encoding);
 
@@ -563,7 +561,6 @@ 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? term = null;
     public static int transparency_percent = 0;
     public static bool version = false;
     public static string? working_directory = null;
@@ -756,8 +753,6 @@ 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 },
-      { "terminfo", '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" },
       { "version", 0, 0, OptionArg.NONE, ref version,
diff --git a/src/debug.c b/src/debug.c
index cac1a57..ac1c72a 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -59,3 +59,45 @@ _vte_debug_init(void)
   _vte_debug_print(0xFFFFFFFF, "VTE debug flags = %x\n", _vte_debug_flags);
 #endif /* VTE_DEBUG */
 }
+
+const char *
+_vte_debug_sequence_to_string(const char *str)
+{
+#if defined(VTE_DEBUG)
+        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 */
+}
diff --git a/src/debug.h b/src/debug.h
index 9b64a0a..ca048bc 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -64,6 +64,7 @@ typedef enum {
 } VteDebugFlags;
 
 void _vte_debug_init(void);
+const char *_vte_debug_sequence_to_string(const char *str);
 
 extern VteDebugFlags _vte_debug_flags;
 static inline gboolean _vte_debug_on(VteDebugFlags flags) G_GNUC_CONST G_GNUC_UNUSED;
diff --git a/src/interpret.c b/src/interpret.c
index 7d79037..32a8bd1 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -33,13 +33,11 @@
 #include "debug.h"
 #include "iso2022.h"
 #include "matcher.h"
-#include "vteti.h"
 
 int
 main(int argc, char **argv)
 {
        struct _vte_matcher *matcher = NULL;
-       struct _vte_terminfo *terminfo = NULL;
        GArray *array;
        unsigned int i, j;
        int l;
@@ -53,15 +51,15 @@ main(int argc, char **argv)
 
        _vte_debug_init();
 
-       if (argc < 2) {
-               g_print("usage: %s TERM [file]\n", argv[0]);
+        if (argc < 1) {
+                g_print("usage: %s [file]\n", argv[0]);
                return 1;
        }
 
-       if ((argc > 2) && (strcmp(argv[2], "-") != 0)) {
-               infile = open (argv[2], O_RDONLY);
+        if ((argc > 1) && (strcmp(argv[1], "-") != 0)) {
+                infile = open (argv[1], O_RDONLY);
                if (infile == -1) {
-                       g_print("error opening %s: %s\n", argv[2],
+                        g_print("error opening %s: %s\n", argv[1],
                                strerror(errno));
                        exit(1);
                }
@@ -70,15 +68,10 @@ main(int argc, char **argv)
        }
 
        g_type_init();
-       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(terminfo);
+        matcher = _vte_matcher_new();
 
        subst = _vte_iso2022_state_new(NULL, VTE_ISO2022_DEFAULT_UTF8_AMBIGUOUS_WIDTH, NULL, NULL);
 
@@ -164,7 +157,6 @@ main(int argc, char **argv)
 
        _vte_iso2022_state_free(subst);
        g_array_free(array, TRUE);
-       _vte_terminfo_unref(terminfo);
        _vte_matcher_free(matcher);
        return 0;
 }
diff --git a/src/keymap.c b/src/keymap.c
index 6edab1d..44a0e67 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -773,7 +773,7 @@ _vte_keymap_map(guint keyval,
                                                   normal_length);
                 _vte_debug_print(VTE_DEBUG_KEYBOARD,
                                  " to '%s'.\n",
-                                 _vte_terminfo_sequence_to_string(*normal));
+                                 _vte_debug_sequence_to_string(*normal));
                 return;
        }
 
diff --git a/src/keymap.h b/src/keymap.h
index 45551cc..81be996 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -24,8 +24,6 @@
 #include <glib.h>
 #include <gdk/gdk.h>
 
-#include "vteti.h"
-
 G_BEGIN_DECLS
 
 #define VTE_META_MASK          GDK_META_MASK
diff --git a/src/matcher.c b/src/matcher.c
index a9f8b2b..e6a0af5 100644
--- a/src/matcher.c
+++ b/src/matcher.c
@@ -33,24 +33,14 @@ 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 GMutex _vte_matcher_mutex;
+static struct _vte_matcher *_vte_matcher_singleton = NULL;
+static int _vte_matcher_ref_count = 0;
 
-static struct _vte_matcher_impl dummy_vte_matcher_trie = {
-       &_vte_matcher_trie
-};
 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,
@@ -60,82 +50,22 @@ _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,
-                  struct _vte_terminfo *terminfo)
+_vte_matcher_init(struct _vte_matcher *matcher)
 {
        const char *code, *value;
        int i;
 
        _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_init()\n");
 
-       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.
-                 */
+        for (i = 0; _vte_xterm_capability_strings[i].value != NULL; i++) {
+                code = _vte_xterm_capability_strings[i].code;
+                value = _vte_xterm_capability_strings[i].value;
+                _vte_matcher_add(matcher, code, strlen (code),
+                                 value, 0);
         }
 
-       /* Add emulator-specific sequences. */
-        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++) {
-                       code = _vte_xterm_capability_strings[i].code;
-                       value = _vte_xterm_capability_strings[i].value;
-                       _vte_matcher_add(matcher, code, strlen (code),
-                                        value, 0);
-               }
-       }
-
        _VTE_DEBUG_IF(VTE_DEBUG_TRIE) {
                g_printerr("Trie contents:\n");
                _vte_matcher_print(matcher);
@@ -144,34 +74,25 @@ _vte_matcher_init(struct _vte_matcher *matcher,
 }
 
 /* Allocates new matcher structure. */
-static gpointer
-_vte_matcher_create(gpointer key)
+static struct _vte_matcher *
+_vte_matcher_create(void)
 {
-        struct _vte_terminfo *terminfo = key;
        struct _vte_matcher *ret = NULL;
 
        _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_create()\n");
        ret = g_slice_new(struct _vte_matcher);
-       ret->impl = &dummy_vte_matcher_trie;
+        /* FIXMEchpe,egmont: The trie matcher is never used, we should remove it */
+        ret->impl = &dummy_vte_matcher_table;
        ret->match = NULL;
        ret->free_params = NULL;
 
-        /* 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;
-       }
-
        return ret;
 }
 
 /* Noone uses this matcher, free it. */
 static void
-_vte_matcher_destroy(gpointer value)
+_vte_matcher_destroy(struct _vte_matcher *matcher)
 {
-       struct _vte_matcher *matcher = value;
-
        _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_destroy()\n");
        if (matcher->free_params != NULL) {
                g_value_array_free (matcher->free_params);
@@ -183,46 +104,39 @@ _vte_matcher_destroy(gpointer value)
 
 /* Create and init matcher. */
 struct _vte_matcher *
-_vte_matcher_new(struct _vte_terminfo *terminfo)
+_vte_matcher_new(void)
 {
        struct _vte_matcher *ret = NULL;
 
-        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((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);
-       }
+        g_mutex_lock(&_vte_matcher_mutex);
 
-       ret = g_cache_insert(_vte_matcher_cache, terminfo);
+        if (_vte_matcher_ref_count++ == 0) {
+                g_assert(_vte_matcher_singleton == NULL);
+                ret = _vte_matcher_create();
 
-       if (ret->match == NULL) {
-               ret->impl = ret->impl->klass->create();
-               ret->match = ret->impl->klass->match;
-               _vte_matcher_init(ret, terminfo);
+                if (ret->match == NULL) {
+                        ret->impl = ret->impl->klass->create();
+                        ret->match = ret->impl->klass->match;
+                        _vte_matcher_init(ret);
+                }
+                _vte_matcher_singleton = ret;
        }
 
-       g_static_mutex_unlock(&_vte_matcher_mutex);
-        G_GNUC_END_IGNORE_DEPRECATIONS;
-       return ret;
+        g_mutex_unlock(&_vte_matcher_mutex);
+        return _vte_matcher_singleton;
 }
 
 /* Free a matcher. */
 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;
+        g_assert(_vte_matcher_singleton != NULL);
+        g_mutex_lock(&_vte_matcher_mutex);
+        if (--_vte_matcher_ref_count == 0) {
+                _vte_matcher_destroy(matcher);
+                _vte_matcher_singleton = NULL;
+        }
+        g_mutex_unlock(&_vte_matcher_mutex);
 }
 
 /* Check if a string matches a sequence the matcher knows about. */
diff --git a/src/matcher.h b/src/matcher.h
index 3136fc8..2522c39 100644
--- a/src/matcher.h
+++ b/src/matcher.h
@@ -23,7 +23,6 @@
 
 
 #include <glib-object.h>
-#include "vteti.h"
 
 G_BEGIN_DECLS
 
@@ -53,7 +52,7 @@ struct _vte_matcher_class{
 };
 
 /* Create and init matcher. */
-struct _vte_matcher *_vte_matcher_new(struct _vte_terminfo *terminfo);
+struct _vte_matcher *_vte_matcher_new(void);
 
 /* Free a matcher. */
 void _vte_matcher_free(struct _vte_matcher *matcher);
diff --git a/src/pty.c b/src/pty.c
index 86d4c8f..c2333b6 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -226,7 +226,6 @@ struct _VtePtyPrivate {
         VtePtyFlags flags;
         int pty_fd;
 
-        const char *term;
         VtePtyChildSetupData child_setup_data;
 
         gpointer helper_tag; /* only use when using_helper is TRUE */
@@ -354,9 +353,9 @@ vte_pty_child_setup (VtePty *pty)
        _vte_pty_reset_signal_handlers();
 
         /* Now set the TERM environment variable */
-        if (priv->term != NULL) {
-                g_setenv("TERM", priv->term, TRUE);
-        }
+        /* FIXME: Setting environment here seems to have no effect, the merged envp2 will override on exec.
+         * By the way, we'd need to set the one from there, if any. */
+        g_setenv("TERM", VTE_DEFAULT_TERM, TRUE);
 
         g_snprintf (version, sizeof (version), "%u", VTE_VERSION_NUMERIC);
         g_setenv ("VTE_VERSION", version, TRUE);
@@ -374,7 +373,6 @@ vte_pty_child_setup (VtePty *pty)
 /*
  * __vte_pty_merge_environ:
  * @envp: environment vector
- * @term_value: the value for the TERM env variable, or %NULL
  * @inherit: whether to use the parent environment
  *
  * Merges @envp to the parent environment, and returns a new environment vector.
@@ -383,7 +381,6 @@ vte_pty_child_setup (VtePty *pty)
  */
 static gchar **
 __vte_pty_merge_environ (char **envp,
-                         const char *term_value,
                          gboolean inherit)
 {
        GHashTable *table;
@@ -405,6 +402,9 @@ __vte_pty_merge_environ (char **envp,
                g_strfreev (parent_environ);
        }
 
+        /* Make sure the one in envp overrides the default. */
+        g_hash_table_replace (table, g_strdup ("TERM"), g_strdup (VTE_DEFAULT_TERM));
+
        if (envp != NULL) {
                for (i = 0; envp[i] != NULL; i++) {
                        name = g_strdup (envp[i]);
@@ -417,9 +417,6 @@ __vte_pty_merge_environ (char **envp,
                }
        }
 
-        if (term_value != NULL)
-                g_hash_table_replace (table, g_strdup ("TERM"), g_strdup (term_value));
-
         g_hash_table_replace (table, g_strdup ("VTE_VERSION"), g_strdup_printf ("%u", VTE_VERSION_NUMERIC));
 
        array = g_ptr_array_sized_new (g_hash_table_size (table) + 1);
@@ -493,7 +490,7 @@ __vte_pty_spawn (VtePty *pty,
         spawn_flags &= ~VTE_SPAWN_NO_PARENT_ENVV;
 
         /* add the given environment to the childs */
-        envp2 = __vte_pty_merge_environ (envv, pty->priv->term, inherit_envv);
+        envp2 = __vte_pty_merge_environ (envv, inherit_envv);
 
         _VTE_DEBUG_IF (VTE_DEBUG_MISC) {
                 g_printerr ("Spawing command:\n");
@@ -1431,7 +1428,6 @@ enum {
         PROP_0,
         PROP_FLAGS,
         PROP_FD,
-        PROP_TERM
 };
 
 /* GInitable impl */
@@ -1530,7 +1526,6 @@ vte_pty_init (VtePty *pty)
         priv->foreign = FALSE;
         priv->using_helper = FALSE;
         priv->helper_tag = NULL;
-        priv->term = vte_get_default_emulation(); /* already interned */
 }
 
 static void
@@ -1573,10 +1568,6 @@ vte_pty_get_property (GObject    *object,
                 g_value_set_int(value, vte_pty_get_fd(pty));
                 break;
 
-        case PROP_TERM:
-                g_value_set_string(value, priv->term);
-                break;
-
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
         }
@@ -1601,10 +1592,6 @@ vte_pty_set_property (GObject      *object,
                 priv->foreign = (priv->pty_fd != -1);
                 break;
 
-        case PROP_TERM:
-                vte_pty_set_term(pty, g_value_get_string(value));
-                break;
-
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
         }
@@ -1654,22 +1641,6 @@ vte_pty_class_init (VtePtyClass *klass)
                                    G_PARAM_READWRITE |
                                    G_PARAM_CONSTRUCT_ONLY |
                                    G_PARAM_STATIC_STRINGS));
-
-        /**
-         * VtePty:term:
-         *
-         * The value to set for the TERM environment variable just after
-         * forking.
-         *
-         * Since: 0.26
-         */
-        g_object_class_install_property
-                (object_class,
-                 PROP_TERM,
-                 g_param_spec_string ("term", NULL, NULL,
-                                      "xterm",
-                                      G_PARAM_READWRITE |
-                                      G_PARAM_STATIC_STRINGS));
 }
 
 /* public API */
@@ -1795,30 +1766,3 @@ vte_pty_get_fd (VtePty *pty)
 
         return priv->pty_fd;
 }
-
-/**
- * vte_pty_set_term:
- * @pty: a #VtePty
- * @emulation: (allow-none): the name of a terminal description, or %NULL
- *
- * Sets what value of the TERM environment variable to set just after forking.
- *
- * Since: 0.26
- */
-void
-vte_pty_set_term (VtePty *pty,
-                  const char *emulation)
-{
-        VtePtyPrivate *priv;
-
-        g_return_if_fail(VTE_IS_PTY(pty));
-        g_return_if_fail(emulation != NULL);
-
-        priv = pty->priv;
-        emulation = g_intern_string(emulation);
-        if (emulation == priv->term)
-                return;
-
-        priv->term = emulation;
-        g_object_notify(G_OBJECT(pty), "term");
-}
diff --git a/src/table.c b/src/table.c
index be2cd31..75fad08 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 terminfo sequence %s\n",
+                                                          "Invalid sequence %s\n",
                                                          original);
                                }
                        } /* else Literal. */
diff --git a/src/vte-private.h b/src/vte-private.h
index ee0f0a5..cc19614 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -168,7 +168,6 @@ struct _VteTerminalPrivate {
         glong column_count;
 
        /* Emulation setup data. */
-       struct _vte_terminfo *terminfo; /* terminfo */
        struct _vte_matcher *matcher;   /* control sequence matcher */
        const char *emulation;          /* terminal type to emulate */
         gboolean autowrap;              /* auto wraparound at right margin */
diff --git a/src/vte.c b/src/vte.c
index 8ab72e1..0890a6d 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -55,7 +55,6 @@
 #include "vteint.h"
 #include "vtepty.h"
 #include "vtepty-private.h"
-#include "vteti.h"
 
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
@@ -80,7 +79,6 @@ typedef gunichar wint_t;
 #endif
 
 static void vte_terminal_set_visibility (VteTerminal *terminal, GdkVisibilityState state);
-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);
@@ -155,7 +153,6 @@ enum {
         PROP_CURRENT_DIRECTORY_URI,
         PROP_CURRENT_FILE_URI,
         PROP_DELETE_BINDING,
-        PROP_EMULATION,
         PROP_ENCODING,
         PROP_FONT_DESC,
         PROP_FONT_SCALE,
@@ -813,17 +810,6 @@ vte_terminal_emit_commit(VteTerminal *terminal, const gchar *text, gssize length
                g_slice_free1(length+1, wrapped);
 }
 
-/* Emit an "emulation-changed" signal. */
-static void
-vte_terminal_emit_emulation_changed(VteTerminal *terminal)
-{
-       _vte_debug_print(VTE_DEBUG_SIGNALS,
-                       "Emitting `emulation-changed'.\n");
-       g_signal_emit_by_name(terminal, "emulation-changed");
-        g_object_notify(G_OBJECT(terminal), "emulation");
-
-}
-
 /* Emit an "encoding-changed" signal. */
 static void
 vte_terminal_emit_encoding_changed(VteTerminal *terminal)
@@ -3371,8 +3357,6 @@ vte_terminal_pty_new_sync(VteTerminal *terminal,
         if (pty == NULL)
                 return NULL;
 
-        vte_pty_set_term(pty, vte_terminal_get_emulation(terminal));
-
         return pty;
 }
 
@@ -3475,8 +3459,8 @@ vte_get_user_shell (void)
  *
  * Starts the specified command under a newly-allocated controlling
  * pseudo-terminal.  The @argv and @envv lists should be %NULL-terminated.
- * The "TERM" environment variable is automatically set to reflect the
- * terminal widget's emulation setting.
+ * The "TERM" environment variable is automatically set to a default value,
+ * but can be overridden from @envv.
  * @pty_flags controls logging the session to the specified system log files.
  *
  * Note that %G_SPAWN_DO_NOT_REAP_CHILD will always be added to @spawn_flags.
@@ -5092,7 +5076,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->terminfo != NULL) {
+                if (handled == FALSE) {
                        _vte_keymap_map(keyval, modifiers,
                                        terminal->pvt->cursor_mode == VTE_KEYMODE_APPLICATION,
                                        terminal->pvt->keypad_mode == VTE_KEYMODE_APPLICATION,
@@ -7932,82 +7916,6 @@ vte_terminal_set_vadjustment(VteTerminal *terminal,
                                 terminal);
 }
 
-/**
- * vte_terminal_set_emulation:
- * @terminal: a #VteTerminal
- * @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 terminfo file.  Unless you
- * are interested in this feature, always use "xterm".
- */
-void
-vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
-{
-        GObject *object;
-
-       g_return_if_fail(VTE_IS_TERMINAL(terminal));
-
-        object = G_OBJECT(terminal);
-
-        g_object_freeze_notify(object);
-
-       /* Set the emulation type, for reference. */
-       if (emulation == NULL) {
-               emulation = vte_get_default_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 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(terminal->pvt->terminfo);
-
-       /* Notify observers that we changed our emulation. */
-       vte_terminal_emit_emulation_changed(terminal);
-
-        g_object_thaw_notify(object);
-}
-
-/**
- * vte_get_default_emulation:
- *
- * Returns the default emulation, which is used in #VteTerminal if the
- * terminal type passed to vte_terminal_set_emulation() is %NULL.
- *
- * Returns: (transfer none) (type utf8): an interned string containing the name
- *   of the default terminal type the widget attempts to emulate
- *
- * Since: 0.30
- */
-const char *
-vte_get_default_emulation(void)
-{
-       return g_intern_static_string(VTE_DEFAULT_EMULATION);
-}
-
-/**
- * vte_terminal_get_emulation:
- * @terminal: a #VteTerminal
- *
- * Queries the terminal for its current emulation, as last set by a call to
- * vte_terminal_set_emulation().
- *
- * Returns: an interned string containing the name of the terminal type the
- *   widget is attempting to emulate
- */
-const char *
-vte_terminal_get_emulation(VteTerminal *terminal)
-{
-       g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
-       return terminal->pvt->emulation;
-}
-
 void
 _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ...)
 {
@@ -8024,34 +7932,6 @@ _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ..
        g_free (str);
 }
 
-/* Set the path to the terminfo file we read, and read it in. */
-static void
-vte_terminal_set_terminfo(VteTerminal *terminal)
-{
-        GObject *object = G_OBJECT(terminal);
-        const char *emulation;
-
-        g_object_freeze_notify(object);
-
-        emulation = terminal->pvt->emulation ? terminal->pvt->emulation
-                                             : vte_get_default_emulation();
-
-       _vte_debug_print(VTE_DEBUG_MISC, "Loading terminfo `%s'...",
-                        emulation);
-       if (terminal->pvt->terminfo != NULL) {
-               _vte_terminfo_unref(terminal->pvt->terminfo);
-       }
-       terminal->pvt->terminfo = _vte_terminfo_new(emulation);
-       _vte_debug_print(VTE_DEBUG_MISC, "\n");
-       if (terminal->pvt->terminfo == NULL) {
-               _vte_terminal_inline_error_message(terminal,
-                               "Failed to load terminal capabilities for '%s'",
-                               emulation);
-       }
-
-        g_object_thaw_notify(object);
-}
-
 static void
 _vte_terminal_codeset_changed_cb(struct _vte_iso2022_state *state, gpointer p)
 {
@@ -8059,8 +7939,8 @@ _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 terminfo file, and
- * set ourselves up to do the interpretation of sequences. */
+ * We need to create a new psuedo-terminal pair, and set ourselves up to do
+ * the interpretation of sequences. */
 static void
 vte_terminal_init(VteTerminal *terminal)
 {
@@ -8133,16 +8013,16 @@ vte_terminal_init(VteTerminal *terminal)
        vte_terminal_set_encoding(terminal, NULL);
        g_assert(terminal->pvt->encoding != NULL);
 
-       /* Load the terminfo data and set up the emulation. */
+        /* Set up the emulation. */
        pvt->keypad_mode = VTE_KEYMODE_NORMAL;
        pvt->cursor_mode = VTE_KEYMODE_NORMAL;
         pvt->autowrap = TRUE;
        pvt->dec_saved = g_hash_table_new(NULL, NULL);
+        pvt->matcher = _vte_matcher_new();
 
        /* Setting the terminal type and size requires the PTY master to
         * be set up properly first. */
         pvt->pty = NULL;
-       vte_terminal_set_emulation(terminal, NULL);
         vte_terminal_set_size(terminal, VTE_COLUMNS, VTE_ROWS);
        pvt->pty_input_source = 0;
        pvt->pty_output_source = 0;
@@ -8633,9 +8513,6 @@ vte_terminal_finalize(GObject *object)
        if (terminal->pvt->matcher != NULL) {
                _vte_matcher_free(terminal->pvt->matcher);
        }
-       if (terminal->pvt->terminfo != NULL) {
-               _vte_terminfo_unref(terminal->pvt->terminfo);
-       }
 
        remove_update_timeout (terminal);
 
@@ -10680,9 +10557,6 @@ vte_terminal_get_property (GObject *object,
                 case PROP_DELETE_BINDING:
                         g_value_set_enum (value, pvt->delete_binding);
                         break;
-                case PROP_EMULATION:
-                        g_value_set_string (value, vte_terminal_get_emulation (terminal));
-                        break;
                 case PROP_ENCODING:
                         g_value_set_string (value, vte_terminal_get_encoding (terminal));
                         break;
@@ -10775,9 +10649,6 @@ vte_terminal_set_property (GObject *object,
                 case PROP_DELETE_BINDING:
                         vte_terminal_set_delete_binding (terminal, g_value_get_enum (value));
                         break;
-                case PROP_EMULATION:
-                        vte_terminal_set_emulation (terminal, g_value_get_string (value));
-                        break;
                 case PROP_ENCODING:
                         vte_terminal_set_encoding (terminal, g_value_get_string (value));
                         break;
@@ -10895,7 +10766,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
        /* Initialize default handlers. */
        klass->eof = NULL;
        klass->child_exited = NULL;
-       klass->emulation_changed = NULL;
        klass->encoding_changed = NULL;
        klass->char_size_changed = NULL;
        klass->window_title_changed = NULL;
@@ -11072,22 +10942,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
                     G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT);
 
         /**
-         * VteTerminal::emulation-changed:
-         * @vteterminal: the object which received the signal
-         *
-         * Emitted whenever the terminal's emulation changes, only possible at
-         * the parent application's request.
-         */
-       g_signal_new(I_("emulation-changed"),
-                    G_OBJECT_CLASS_TYPE(klass),
-                    G_SIGNAL_RUN_LAST,
-                    G_STRUCT_OFFSET(VteTerminalClass, emulation_changed),
-                    NULL,
-                    NULL,
-                    g_cclosure_marshal_VOID__VOID,
-                    G_TYPE_NONE, 0);
-
-        /**
          * VteTerminal::char-size-changed:
          * @vteterminal: the object which received the signal
          * @width: the new character cell width
@@ -11552,22 +11406,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
                                     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 terminfo file.  Unless you
-         * are interested in this feature, always use the default which is "xterm".
-         *
-         * Since: 0.20
-         */
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_EMULATION,
-                 g_param_spec_string ("emulation", NULL, NULL,
-                                      VTE_DEFAULT_EMULATION,
-                                      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
-        /**
          * VteTerminal:font-scale:
          *
          * The terminal's font scale.
diff --git a/src/vteglobals.h b/src/vteglobals.h
index 9eb5e92..b6abe2b 100644
--- a/src/vteglobals.h
+++ b/src/vteglobals.h
@@ -23,8 +23,6 @@
 
 G_BEGIN_DECLS
 
-const char *vte_get_default_emulation(void);
-
 char *vte_get_user_shell(void);
 
 G_END_DECLS
diff --git a/src/vtepty.h b/src/vtepty.h
index d1115f9..c4f17cc 100644
--- a/src/vtepty.h
+++ b/src/vtepty.h
@@ -86,9 +86,6 @@ gboolean vte_pty_set_utf8 (VtePty *pty,
                            gboolean utf8,
                            GError **error) _VTE_GNUC_NONNULL(1);
 
-void vte_pty_set_term (VtePty *pty,
-                       const char *emulation) _VTE_GNUC_NONNULL(1);
-
 G_END_DECLS
 
 #endif /* __VTE_VTE_PTY_H__ */
diff --git a/src/vteseq.c b/src/vteseq.c
index 6bf2e88..144a7a4 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -28,7 +28,6 @@
 
 #include "vte.h"
 #include "vte-private.h"
-#include "vteti.h"
 
 #define BEL "\007"
 #define ST _VTE_CAP_ST
@@ -3086,10 +3085,6 @@ vte_sequence_handler_reset_highlight_foreground_color (VteTerminal *terminal, GV
 
 #define VTE_SEQUENCE_HANDLER(name) name
 
-static const struct vteseq_2_struct *
-vteseq_2_lookup (register const char *str, register unsigned int len);
-#include"vteseq-2.c"
-
 static const struct vteseq_n_struct *
 vteseq_n_lookup (register const char *str, register unsigned int len);
 #include"vteseq-n.c"
@@ -3103,10 +3098,6 @@ _vte_sequence_get_handler (const char *name)
 
        if (G_UNLIKELY (len < 2)) {
                return NULL;
-       } else if (len == 2) {
-               const struct vteseq_2_struct *seqhandler;
-               seqhandler = vteseq_2_lookup (name, 2);
-               return seqhandler ? seqhandler->handler : NULL;
        } else {
                const struct vteseq_n_struct *seqhandler;
                seqhandler = vteseq_n_lookup (name, len);
diff --git a/src/vteterminal.h b/src/vteterminal.h
index 0cfc25f..dc479b5 100644
--- a/src/vteterminal.h
+++ b/src/vteterminal.h
@@ -70,7 +70,6 @@ struct _VteTerminalClass {
        /* Default signal handlers. */
        void (*eof)(VteTerminal* terminal);
        void (*child_exited)(VteTerminal* terminal, int status);
-       void (*emulation_changed)(VteTerminal* terminal);
        void (*encoding_changed)(VteTerminal* terminal);
        void (*char_size_changed)(VteTerminal* terminal, guint char_width, guint char_height);
        void (*window_title_changed)(VteTerminal* terminal);
@@ -323,11 +322,6 @@ gboolean  vte_terminal_search_find_previous   (VteTerminal *terminal) _VTE_GNUC_
 gboolean  vte_terminal_search_find_next       (VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
 
 
-/* Set the emulation type.  Most of the time you won't need this. */
-void vte_terminal_set_emulation(VteTerminal *terminal,
-                                const char *emulation) _VTE_GNUC_NONNULL(1);
-const char *vte_terminal_get_emulation(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
-
 /* Set the character encoding.  Most of the time you won't need this. */
 void vte_terminal_set_encoding(VteTerminal *terminal,
                                const char *codeset) _VTE_GNUC_NONNULL(1);



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