Why I stick with Suckless Terminal (st)

3 minute read

With many terminal options available with lots of features, here’s why one programmer chooses to keep it simple in 2022.

My terminal of choice is st, That’s right, Suckless Terminal, and I do use dwm as well. After many years of trying and using urxvt, xterm, Gnome Terminal, Konsole, Xfce Terminal, I found I dont like and need so many features from a terminal and using one that compiles in seconds is a lot better for my productivity than others.

I start my terminal with a key combination I configured in dwm’s config.h:

static const char *termcmd[]  = { "st", NULL };
...
{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },

It launches my terminal on the current tag I’m on and I’m either typing the command I need at the moment or launching tmux for a longer session. With tmux, I can keep connected to servers, proxy to virtual machines for that special IP address I need to access certain services or work with clients and I can keep running commands that require time to run.

Patches

I’m using a number of patches with my Suckless Terminal, mainly for easthetics:

st-alpha-0.8.2.diff
st-anysize-0.8.4.diff
st-blinking_cursor-20200531-a2a7044.diff

I need the blinking cursor so I can find it any time on my large monitor. There’s nothing more annoying in a terminal when I don’t know within a split second where my keystroke will end up. anysize is needed so I don’t see the background sticking out at the bottom of the screen because the desktop height does not match the height of the terminal.

Colors

I’m using a warm, pastel-ish colour scheme so if my eyes are tired by the end of the day, I can still see my work clearly:

terminal colors

/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
  /* 8 normal colors */
  [0] = "#282828", /* hard contrast: #1d2021 / soft contrast: #32302f */
  [1] = "#cc241d", /* red     */
  [2] = "#00b300", /* green   */
  [3] = "#d79921", /* yellow  */
  [4] = "#3d528f", /* blue    */
  [5] = "#b16286", /* magenta */
  [6] = "#51b4b3", /* cyan    */
  [7] = "#bab6ab", /* white   */

  /* 8 bright colors */
  [8]  = "#928374", /* black   */
  [9]  = "#fb4934", /* red     */
  [10] = "#00ff00", /* green   */
  [11] = "#fabd2f", /* yellow  */
  [12] = "#4d67b3", /* blue    */
  [13] = "#d3869b", /* magenta */
  [14] = "#38cdcc", /* cyan    */
  [15] = "#d1cec7", /* white   */

  [255] = 0,

  /* more colors can be added after 255 to use with DefaultXX */
  "#cccccc",
  "#555555",
  "black",
};


/*
 * Default colors (colorname index)
 * foreground, background, cursor, reverse cursor
 */
unsigned int defaultfg = 15;
unsigned int defaultbg = 0;
static unsigned int defaultcs = 15;
static unsigned int defaultrcs = 257;

Selection and paste

One thing I like about st is how copy-paste works. I enabled mouse in tmux, but I still find myself using the shift-selection when I want to move text between the terminal and graphical programs. Holding shift and dragging the mouse will allow me to select text Ctrl+Shift+C copies the text. Ctrl+Insert or Ctrl+Shift+V can paste text to the terminal. Pressing the middle mouse can also copy the X selection to wherever I click with the middle mouse.

Shift+double click selects a word, Shift+triple click selects a whole line.

Font and size

My default font is “Hack Nerd Font”, 22px on HiDPI monitor. It’s quite small for demonstration purposes. If I want to show something in the terminal, I can increase the font size using the Ctrl+Shift+PgUP key combination. Ctrl+Shift+PgDn decreases the size, Ctrl+Shift+Home resets to 22px.

Conclusion

st is more customizable than you might expect, which was my primary reason to choose it. It can be configured in the config.h file and any change here will require a recompilation of st. Don’t worry, this compilation takes seconds on modern computers because st does not have excessive dependencies like many other programs. Thanks to this, it uses very little memory and it starts within a blink of an eye. Ever looked into the source code of xterm? It contains layers of layers of legacy bloat. The developers of urxvt tried to clean it up a bit, and urxvt is also a fair terminal to use with still some legacy and unnecessary code left in it. st consist only about 2600 lines of code and does all that’s required from a terminal.

Updated:

Comments