Terminal Condition

I spend half my time, easily, in a command-line terminal running zsh. So a new one, even one on an OS I don’t run, is interesting:

There are some modern, nice conveniences in this. It’s a little ways behind Mac Terminal.app (based on the NeXTstep Terminal from 1990), and vastly far behind iTerm2, but it’s more advanced than the usual Linux terminals like rxvt, urxvt, or cross-platform Alacritty or Hyper.

Between this and WSL2 being a full Linux, it’s plausible that the best Linux dev environment now (well, this summer when it’s released) is Windows. The Year of the Linux Desktop is 2019, and it is owned by Microsoft®. Can you hear the tiny, distant screams of the FSF cultists?

Comparison based on code, reviews, and reddit thread with MS devs involved:

  • Scrollback: The single most important thing a terminal can do. MS does this, but doesn’t have logging.

    Surprisingly, a lot of them only support a few pages. I keep mine at 10,000 lines or so, which is probably wasteful but so handy; I don’t bother logging since my .zhistory keeps everything I typed, and I have Terminal.app and iTerm2 set to not close tabs automatically.

    Alacritty only just added scrollback last year.

  • Prompt Marking: Nope.

    This is a feature it’s hard to live without once you’ve had it, no more paging up trying to see prompt lines (I have a red ANSI-colored prompt and it’s still hard to see). In Terminal.app, Edit, Marks, Automatically Mark Prompt Lines, and then ⌘↑ and ⌘↓ move between them. iTerm2 has it enabled by default, and ⇑⌘↑ ⇑⌘↓ are the keys, which took me some re-learning.

    Nothing else has this, as far as I’ve seen.

  • Fonts: MS has programming ligatures and displays emoji, finally. Does not support RTL languages.

    I use Fira Code in all my editors and shells, and it’s enormously helpful, more readable, and catches bugs: I look for === as a fat-equals symbol in JS, etc.

    Hyper, urxvt, Alacritty support Unicode fonts. rxvt stopped development almost 20 years ago so it barely shows 8-bit fonts correctly.

  • Tabs: MS has tabs! They’re currently invisible until you add a second tab, same shit Terminal.app does, which annoys the hell out of me; I don’t like UI that reshapes itself, reminds me of T-1000 Terminators (also makes it hard to tile my windows up correctly when they get resized).

    It’s not clear if you can drag Windows Terminal tabs around to different windows.

    In iTerm2, I normally keep: First window with tabs for home shell, ssh into my server (running screen, so that has many open shells). Second window with 2 tabs for REPL, editor/running/compiling tasks, and sometimes a third tab for reading local docs. If I need more shells, I usually open them on the first window. I rarely open a third window for monitoring some long-running task; I just drag a tab out to its own window. All terminal windows are stacked on the left side of my screen, because there’s no icons under that side of the Desktop.

    urxvt has tabs, but they’re kind of a hack, not fully usable.

    Hyper has tabs, but they replace the title bar. Which is cool but also awful like a lot of things it does.

    rxvt and Alacritty don’t do tabs, because they insist you use screen or tmux. Which sucks if you want to move a process from one window to another.

  • Profiles: MS supports multiple profiles, so you can use different ones for each task.

    So does Terminal.app, iTerm2, urxvt (but it’s buried in a text file config).

    Alacritty, rxvt, and Hyper have a single profile and no UI for changing anything, hope you like editing text files and reloading.

    As far as I can tell, nothing else does automatic profile switching like iTerm2; when I cd to my ~/Code/CodeScheme folder, iTerm2 switches to my dark red transparent profile, including Scheme-specific triggers and copy/paste filtering.

    You can probably do that in urxvt’s Perl(!) scripting, but it’s not normal or easy.

  • Copy/Paste Filtering: Nope.

    iTerm2 and urxvt both let you set a bunch of regexp to run over lines to get selections correctly matching boundaries, not just space-delimited.

  • URL Highlighting: Nope.

    iTerm2, Hyper, and urxvt notice URLs and filenames, and let you click on them. In iTerm2, hold down ⌘ and click on any URL or path (like in an ls or find result!) and it does some useful action: Opens the URL in your browser or file path in your editor, by default, but you can configure that in the profile.

  • Custom Keybindings: Sorta? Doesn’t seem complete, no idea if there’s UI for it, but it does exist in their config.

    Most terminals can do this, but most can only remap a few actions. I like iTerm2’s, as usual, which lets you bind any action, menu, or run a program on any keybinding. I mostly just use it to launch different profiles with starting paths & scripts.

    Terminal.app only lets you send specific text for a key.

  • Images: Sorta? Only if they’re embedded in fonts.

    This is a neat trick in iTerm2: images. I use imgls all the time to see a thumbnail of every file with details (protip: I changed ls -ld in the script to ls -1Fskd for a more concise listing), and then ⌘-click to open what I want in Acorn; it’s better than opening Finder and trying to read a long filename under a thumbnail.

    I’m unaware of anyone else being able to do this.