Contour: Modern and Fast Terminal Emulator

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • contour

    Modern C++ Terminal Emulator (by christianparpart)

  • https://github.com/contour-terminal/contour/issues/382

    This apparently does not support the Kitty graphics protocol, just Sixel, which makes it look fairly unattractive to me, personally.

  • kitty

    Cross-platform, fast, feature-rich, GPU based terminal

  • > I tried the first line and in some situations (specifically with some remotes, i.e. kitty -> ssh -> tmux with that 1st line) it still won't fix it.

    You likely need all of them ;-)

    IIRC it "fixes" terminfo stuff "within tmux" for kitty regardless of what $TERM is set. Mind you, I was using the latest tmux at that time. tmux 3.2?

    Here's the issue I had: https://github.com/kovidgoyal/kitty/issues/3018

    Looks like it should be fixed on a very recent tmux; otherwise this MIGHT help:

        set-option -as terminal-features ',xterm-kitty:RGB'

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Windows Terminal

    The new Windows Terminal and the original Windows console host, all in the same place!

  • Also, Microsoft has their own new terminal program.

    https://github.com/microsoft/terminal

  • wezterm

    A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust

  • rlwrap

    A readline wrapper

  • Possibly more universal, but there are also tools like rlwrap [1] that adds readline support to programs that don't have it. From the docs apparently the readline library ships a similar tool ootb nowadays but I haven't tried that and just noticed now when I wanted to share the rlwrap link.

    [1] https://github.com/hanslub42/rlwrap

  • tmux

    tmux source code

  • > I can use the same modifier-key commands to select and manipulate text that I'm used to, which feels super nice.

    I know this is not a complete solution, but just in case you weren’t aware, the keybindings in GNU Readline are nearly entirely configurable[1]. Getting some of the keybindings to work could require digging into serial terminal arcana[2], unfortunately, but here a terminal emulator that supports either the Kitty keyboard protocol[3] or the (venerable if impressively badly documented) modifyOtherKeys switch[4] could make things easier (messing with the serial driver[2] seems an overreaction to me, and you can’t get acceptable Ctrl-C behaviour that way anyway). The “new” terminal emulators mentioned in this thread (alacritty, contour, kitty, wezterm) should be able to do the trick, and of course xterm as well (probably rxvt too?); tmux compat needs help, though[5].

    [1] https://tiswww.cwru.edu/php/chet/readline/rluserman.html#Bin...

    [2] https://susam.net/blog/from-xon-xoff-to-forward-incremental-...

    [3] https://sw.kovidgoyal.net/kitty/keyboard-protocol/

    [4] https://invisible-island.net/xterm/modified-keys.html

    [5] https://github.com/tmux/tmux/issues/3335

  • awesome-tuis

    List of projects that provide terminal user interfaces

  • > Editing multiline inputs is awful.

    Outside of "line at a time" i/o (a rarely used mode where an entire line is edited locally and then sent to the host), most of what users see is as interactive is controlled by the program you are interacting with. The terminal just takes commands from the host and does what it is told. BTW, line at a time mode isn't used that much. The only thing I use that uses line at a time mode is telenet in LINEMODE.

    > Navigating history is so-so

    Yes, that is because the program you are likely interacting with where history is relevant implements it's own repl or command line (i.e. bash, zsh, python, etc...) and it is responsible for it's own history and may implement it completely differently than say, bash or zsh.

    > Why are terminals always stuck in the 70s? Can I get a modern terminal?

    We do have a modern terminal: the web browser... and it's pretty nice.

    There have been a ton of tries at more modern terminals, but ultimately, they end up really being limited by the software running in the terminal session. In the 90s we had a ton of commercial terminal emulators that would allow you to create full guis, complete with dialogs and forms. In the 00's there were a few tries at terminals that would allow html output and embedding of html forms for input (can't remember the names of them). I suppose there's also the whole X11 thing... which is so good enough that it's really hard to kill.

    Let's get back to character mode:

    A lot of interactive terminal software is built using different libraries - so sometimes you get a terminal gui based on ncurses, terminal.gui, or something else... here's a list: https://github.com/rothgar/awesome-tuis#libraries. Most of these libraries try to use most of the features in your terminal emulator, but often, just use stuff that is in everything.

    For command line programs (i.e. just type a command), a lot of the experience is dictated by the parser used by the tool and whatever the underlying operating system has for passing arguments. Some shells and terminal emulators (like iTerm2 on mac) try to smooth this out, but again, there's a lot of variety in command line parsers.

    Probably the biggest modern improvement in the shell world was gettext and various command-line completion libraries which allows command parameter completion if the developer supports it or uses a parser that supports completion. But none of this is the terminal itself doing the work.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • termite

    Discontinued Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.

  • - you can also rectangular select like in vim, and then press either p (includes LF) or which joins the multiline clipboard text into a single line (removing LF's), that payed off a lot for output like `git status` and wanting to operate on parts of the output (files e.g.)

    Have a look at the still young website's documentation here: https://contour-terminal.org/input-modes/#supported-text-obj...

    for a more complete look of what you can do with the keyboard (normal mode) :)

    [1] https://github.com/thestinger/termite/

  • terminal-unicode-core

    Unicode Core specification for Terminal (grapheme clusters, character widths, ...)

  • > It would be nice if someone worked on actually improving the terminal experience.

    Contour. Oh, sorry, I mean: To be honest? There are plenty of young terminals that work on that, it's not just Contour, but also WezTerm, foot, Ghostty, Warp, and Terminal.click (even though I am strongly against their architecture). Also Charm and Fig should earn an honorable mention.

    > Selecting, copying and pasting text is still pretty awful

    Use the vi-like normal mode in Contour and that should(tm) fix almost all of the above problems. At least I have almost never touched a mouse again on Contour since I've implemented modal input in Contour. Well, I use the mouse, casually for scrolling and procrastinating by randomly clicking around. :)

    > (why is the cursor an entire block rather than a I bar?).

    this is configurable in recent terminals

    > Editing multiline inputs is awful.

    this should be implemented by your shell or readline, in case you want to improve here. your TE has nothing to do with this except that it provides the tools to realize that on the screen :)

    > Navigating history is so-so (even with McFly etc.).

    This is the job of the shell/readline.

    > Anything more complicated than left/right/up/down fails half the time and dumps control characters instead.

    I really cannot related that claim to anything I am experiencing in my own life. Sadly.

    > Why are terminals always stuck in the 70s? Can I get a modern terminal?

    To be fair, they are not named "emulator" for fun and giggles. But I agree, not every VT sequence or semantic should be blindingly implemented. Especially the Unicode case on Terminals were always a fight against the historian terminal emulator developers. I asked myself why a lot on that matter. My theory? Because it potentially requires those existing terminals to fully re-write their core code base in order to be fully (as full as it gets) Unicode aware.

    Have a look here for a baby-step forward: https://github.com/contour-terminal/terminal-unicode-core

    This is implemented by 4 terminals (Ghostty, WezTerm, foot, Contour). One bite at a time I guess. Let's just stay positive, we can't break the world! (Terminal.Click? You listening?) But we should certainly break here and there when it makes sense and also not blindingly implement the 70s again. The GUI has also good moments and can live next to the TUI ;)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts