1. 19
  1. 10

    This is another VTE thing, not exactly ‘your own terminal emulator’, since you are subjected to the whims of VTE and its developers.

    1. 5

      Take a look at suckless’ st for a real (and usable!) “implement your own” example. I was surprised by how simple the code is

      1. 1

        Seeing this article actually led me to do just that last night. st is very readable.

        1. 1

          I was going to submit that this weekend. You beat me to it. ;)

        2. 4

          Yeah this is a bit like a ‘Write your own interpreter’ article that presents a metacircular interpreter. Still useful! But it’s just worth bearing in mind that the really interesting bits of those problems are being dealt with by someone else.

        3. 7

          begin mind wandering

          Note that there is some acrimony in the terminal-emulation world, because many terminals that use the VTE library claim to be an xterm (or xterm-256color) via the $TERM environment variable, but they aren’t xterms at all, and in fact don’t honor many of the huge number of control sequences supported by the xterm.

          (For example, VTE doesn’t emulate xterm’s block-move functionality, selective-delete functionality, or double-height characters. The latter two features were inherited from the VT2xx and the VT100.)

          The same thing is common throughout the terminal emulation world, and has been for ages. The purists (myself included) believe that you shouldn’t say you’re an xterm (or whatever terminal) if you don’t emulate that terminal exactly, but even back in the Good Old Days countless terminals claimed to be VT100s when in fact they supported only some of the VT100’s functionality, or behaved differently in subtle but important ways.

          (Basically nobody implemented the VT52 mode provided by the VT100.)

          Even back then, as today, the world settled on a more-or-less “common subset” of control sequences that everyone agreed “VT100” (or, today, “xterm”) means, but at the cost of essentially ignoring the advanced features offered by the “real” terminal in question.

          (Well, “the world” so long as we assume DEC wasn’t in “the world”. Try using VMS with a terminal that says it’s a VT240 but isn’t and see how it goes…)

          There are a few terminals today that can boast “relatively complete” VT100 emulation: xterm (the actual xterm), PuTTY, mtm (in the “full-featured” tag), and a few others, but the sad truth of the matter is the vast majority of terminals claiming to be “xterm” or “vt100” or “vt220” are lying, and we’re missing out on some cool stuff because everyone instead targets the lowest-common-denominator-terminal associated with those names.

          1. 3

            (Basically nobody implemented the VT52 mode provided by the VT100.)

            IIRC I implemented VT52 mode in ConsoleTelnet, but I also never claimed to be VT100 (I think ConsoleTelnet reported as “ansi”).

            I’m not sure if it was ever useful; it was just necessary in order to pass all the tests in VTTEST.

          2. 3

            This just inspired me to create my own minimal, VTE-based terminal emulator, to get rid of some of the minor things that I found annoying with my previous terminal (gnome-terminal). The major benefit is that there are no menus now, neither app menus nor context menus, and no window decorations, which makes the thing get out of my way even better.

            The last time I was unhappy with my terminal of choice (ROXTerm at the time), I went hunting for a good one, didn’t find any, and settled on gnome-terminal because that was the closest. Seeing how easy it is to build something on top of VTE, I no longer need to settle. Thank you!

            1. 1

              nice, anybody know how change graphics library? GLFW, SDL etc.