descriptionSimple proportional-font terminal (for XWindows)
ownersteve@folta.net
last changeTue, 16 Aug 2022 04:28:43 +0000 (15 21:28 -0700)
content tags
add:
README.md

spft

Simple Proportional-Font Terminal

Inspired by mlterm and st.

mlterm was the only X terminal program I'd found that properly supports proportional (that is, non-monospace) fonts. There should be more than one... and now there is. Also, they broke some of the behavior around the Shift-PageUp/Down keys in version 3.9.1. It seems they wanted to make scrolling a "mode" now, which it hadn't really been before, and they slipped this significant UI change and its associated breakage into a point-point release. That ticked me off enough to prompt me to write this.

st is wonderfully simple in how it's coded. It's a lot easier to find your way around its code than it is for mlterm. It provided accessible examples of how to do various things.

spft is somewhere between the two in both functionality and code style. spft isn't written in a "suckless" style like st is (it's in C++, for a start), but it still aspires to be as minimal and direct as possible. It compiles in under a second for me if I use all the cores on my machine. It also appears to use much less memory than mlterm, even when keeping much more scrollback history.

Status

It doesn't handle every escape sequence known to man, but it seems quite usable at this point.

Elastic Tabs

spft is the first terminal program I know of that supports elastic tabs. At first, I had it do elastic tabs for all tabs. But elastic tabs look terrible if applied to output that's generated for tab-stop tabs. (Often a wide column on one line will be an empty "column" on another line, pushing the meat of the second line way to the right.)

So elastic tabs are enabled by a couple of special escape sequences. "\x1B[?5001h" starts a group of elastic-tabbed lines with the line that the cursor is on. "\x1B[?5001l" ends that group; the line containing the cursor is not part of it. There are also expanded versions of these: "\x1B[?5002;Nh", where N is the number of columns that will be right-justified; and "\x1B?5002;1l" which ends the group, but includes the line with the cursor (useful if you're right-justifying columns in a single line).

An "els" script is included; it wraps "ls" so the output is appropriate for elastic tabs. You might want to put something like this in your .bashrc:

if [ -n "$SPFT" ]; then
    alias ls='els --color=always'
    fi

I use "Helvetica Neue Light". I wish I could find a free font that looks as nice as that.

What it still needs

shortlog
2022-08-16 Steve FoltaBackspace sends DEL instead of ^H.master
2022-06-10 Steve FoltaFixed a crash if it receives a stray mouse-up event.
2022-05-31 Steve FoltaErase in Display: updating "at_end_of_line".
2022-02-27 Steve FoltaEscape clause: Fixed chars-per-line calculation for...
2022-02-27 Steve FoltaEscape clause: Alt-Esc toggles to a monospace font.
2022-02-27 Steve FoltaFontSet: implementing "skip_italics".
2022-02-27 Steve FoltaFontSet becomes its own object.
2022-01-29 Steve FoltaFixed anchoring of by-word selection when transitioning...
2021-12-29 Steve FoltaSettings: broke out the parse_setting() function.
2021-12-29 Steve FoltaMan page: font size adjustment.
2021-12-28 Steve FoltaShift-Insert (reload settings) clears font size adjustment.
2021-12-28 Steve FoltaFixed occasional crash when a separate line-drawing...
2021-12-28 Steve FoltaUsing XftFontMatch() instead of FcFontMatch().
2021-12-28 Steve FoltaAdjust font size using Alt-+/-.
2021-11-15 Steve FoltaQuick fix for a crash.
2021-11-10 Steve FoltaElastic-tabs: adding the ability to right-justify some...
...
heads
20 months ago master