How To Use St: A Practical Guide To The Suckless Terminal
26 August 2026, 04:42
The `st` terminal emulator, also known as "suckless terminal," is a lightweight, minimal, and highly configurable terminal that has gained a devoted following among Unix enthusiasts. Unlike heavyweight terminals like GNOME Terminal or Konsole, `st` prioritizes simplicity, speed, and code clarity over feature bloat. This guide will walk you through installation, configuration, daily usage, and advanced customization—ensuring you can harness the full power of `st` without drowning in complexity.
`st` is not typically packaged in mainstream repositories, so you will most likely need to build it from source. The process is straightforward:
```bash git clone https://git.suckless.org/st cd st ``` You need a C compiler (e.g., `gcc` or `clang`), `make`, and X11 development headers. On Debian/Ubuntu: ```bash sudo apt install build-essential libx11-dev libxft-dev libxext-dev ``` On Arch Linux: ```bash sudo pacman -S base-devel libx11 libxft libxext ``` ```bash sudo make clean install ``` This places the `st` binary in `/usr/local/bin`. You can now launch it by typing `st` in your current terminal.Tip: If you prefer a local install (no root), use: ```bash make clean install PREFIX=~/.local ``` Then add `~/.local/bin` to your `PATH`.
Once `st` launches, it behaves like any standard terminal. You can run shell commands, use `vim`, `htop`, or any TUI application. However, a few keybindings are essential:
| Shortcut | Action | ||| | `Ctrl+Shift+C` | Copy selected text | | `Ctrl+Shift+V` | Paste from clipboard | | `Ctrl+Shift+PageUp/PageDown` | Scroll up/down (requires `scrollback` patch) | | `Ctrl+Shift+Enter` | Open a new terminal window (if compiled with `anygeometry` patch) |
Note: By default, `st` does not support mouse-based text selection. You must hold `Shift` and drag the mouse to select. This is intentional—it prevents accidental selections when running mouse-driven TUI apps.
The heart of `st` is the `config.h` file. After any change, you must recompile: ```bash make clean install ```
Locate the `font` line in `config.h`: ```c static charfont = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; ``` Replace with your preferred font, e.g.,: ```c static charfont = "JetBrains Mono:size=11"; ``` For fallback fonts, use a comma-separated list: ```c static charfont = "JetBrains Mono:size=11, Noto Sans CJK SC:size=11"; ``` Find the `colorname` array. The first 16 entries are the standard ANSI colors, followed by foreground, background, and cursor colors. For a dark theme: ```c static const charcolorname[] = { "#282828", /0: black/ "#cc241d", /1: red/ "#98971a", /2: green/ "#d79921", /3: yellow/ "#458588", /4: blue/ "#b16286", /5: magenta/ "#689d6a", /6: cyan/ "#a89984", /7: white/ "#928374", /8: bright black/ "#fb4934", /9: bright red/ "#b8bb26", /10: bright green/ "#fabd2f", /11: bright yellow/ "#83a598", /12: bright blue/ "#d3869b", /13: bright magenta/ "#8ec07c", /14: bright cyan/ "#ebdbb2", /15: bright white/ [255] = "#282828", /foreground/ [256] = "#ebdbb2", /background/ [257] = "#ebdbb2", /cursor/ }; ``` If you want a semi-transparent background, add this line: ```c static const unsigned int alpha = 0xcc; /0x00 opaque, 0xff fully transparent/ ``` Then recompile. Note: This requires the `alpha` patch or a version of `st` that supports it.The vanilla `st` is intentionally bare. The community maintains a rich patch ecosystem. Here are the most useful ones:
Without this patch, you cannot scroll back through output. Apply it after downloading the patch: ```bash curl -O https://st.suckless.org/patches/scrollback/st-scrollback-0.9.diff patch -p1 < st-scrollback-0.9.diff make clean install ``` Now `Ctrl+Shift+PageUp` and `Ctrl+Shift+PageDown` work. By default, `st` only uses the X11 primary selection (middle-click paste). To integrate with your system clipboard: ```bash curl -O https://st.suckless.org/patches/clipboard/st-clipboard-0.8.5.diff patch -p1 < st-clipboard-0.8.5.diff ``` Then in `config.h`, set your clipboard command (e.g., `xclip` or `wl-clipboard`): ```c static charclipboard = "xclip -selection clipboard"; ``` If you need emoji or fallback fonts for CJK characters, apply the `font2` patch. It adds a secondary font slot.Warning: Patches are version-specific. Always check the patch name against your `st` version (run `st -v`).
Since `st` lacks built-in tab management, pair it with `tmux` for a powerful workflow: ```bash st -e tmux new -A -s main ``` This attaches to a session named `main` or creates it if missing. Use X11 flags: ```bash st -g 100x30+50+50 ``` This opens a 100-column by 30-line terminal at position (50,50). You can also set default geometry in `config.h`: ```c static const chargeometry = "100x30+50+50"; ``` For window managers like `dwm` or `i3`, add a keybinding. In `dwm`'s `config.h`: ```c { MODKEY, XK_Return, spawn, {.v = "st" } }, ``` In `i3`: ``` bindsym $mod+Return exec st ``` `st` is already light, but you can reduce flicker by disabling the cursor blink: ```c static unsigned int cursorblink = 0; ``` Also, consider setting `dynamiccursor` to `0` if you don't need a live-updating cursor shape. Ensure your font name is correct using `fc-list | grep "Your Font"`. If you use `pixelsize`, remember that `st` uses pixels, not points. For HiDPI displays, increase the pixel size accordingly. Some shortcuts (e.g., `Alt+F4`) may not work because `st` interprets `Alt` as the Meta key. In `config.h`, set: ```c static Shortcut shortcuts[] = { ... }; ``` Add a custom shortcut if needed. Alternatively, use `M-x` notation in your shell. When you SSH into a remote machine, clipboard integration may break. Use `tmux` on the remote side and enable `set -g set-clipboard on`. For local clipboard, ensure your `clipboard` command is absolute (e.g., `/usr/bin/xclip`).`st` is not for everyone. It lacks tabs, dropdown mode, and GUI settings. But its