How To Use St: A Practical Guide To The Simple Terminal
02 July 2026, 01:55
The Simple Terminal, commonly known as `st`, is a lightweight terminal emulator for the X Window System. Developed by suckless.org, it prioritizes minimalism, speed, and code clarity over feature bloat. Unlike full-featured terminals like GNOME Terminal or Konsole, `st` offers a bare-bones experience that can be customized through source code patching. This guide will walk you through everything you need to know to install, configure, and use `st` effectively.
Before diving into usage, understand that `st` is not a plug-and-play terminal. It compiles from source, meaning you modify its behavior by editing C header files and applying patches. This approach gives you total control but requires basic familiarity with compiling software. The terminal itself occupies under 2000 lines of code, making it extremely fast and resource-efficient.
Most Linux distributions include `st` in their repositories. Install it with:The package name may be `st` or `stterm`. After installation, launch it by typing `st` in your current terminal or adding it to your window manager's menu.
For full customization, compile from the official repository:1. Clone the source: `git clone https://git.suckless.org/st` 2. Enter the directory: `cd st` 3. Edit `config.def.h` to change default settings (see Step 2) 4. Build and install: `sudo make clean install`
This installs `st` to `/usr/local/bin`. To revert to defaults, run `git checkout config.def.h` and reinstall.
`st` uses a single header file for configuration. The default file is `config.def.h`, but after installation, you should copy it to `config.h` to preserve your changes during updates.
1. Font: Change the `font` variable to your preferred monospace font. Example: `"Monospace:size=12"` or `"Fira Code:size=11"`. Use `xfontsel` to browse available fonts.
2. Colors: The `colorname` array defines 16 terminal colors. The first two entries are foreground and background. For a dark theme, set background to `"#282828"` and foreground to `"#ebdbb2"`.
3. Scrollback: By default, `st` has no scrollback buffer. Add this line to `config.h`: ```c static int scrollback = 1000; ``` Then rebuild. You can scroll with `Shift+PageUp` and `Shift+PageDown`.
4. Key Bindings: The `shortcuts` array maps key combinations to actions. For example, to bind `Alt+Enter` to toggle fullscreen, add: ```c { MODKEY, XK_Return, togglefullscreen, {0} }, ```
After editing `config.h`, recompile with `make` and reinstall with `sudo make install`.
These shortcuts are configurable. Note that `st` does not support mouse-based selection by default—you must hold `Shift` while clicking and dragging to select text.
1. Navigate to the text you want to copy using keyboard scrolling. 2. Press `Alt+Shift+C` to copy the entire visible buffer to the clipboard. 3. To paste, press `Alt+Shift+V`.For more precise selection, enable mouse support by adding a patch (see Step 4).
The real power of `st` lies in its patch ecosystem. Patches modify the source code to add features. Common patches include:
Example to add scrollback: ``` wget https://st.suckless.org/patches/scrollback/st-scrollback-20210507-2b83307.diff patch -p1 < st-scrollback-20210507-2b83307.diff make clean install ```
To manage multiple patches, create a script that applies them in order: ```bash #!/bin/bash cd ~/st-source git checkout . patch -p1 < scrollback.diff patch -p1 < alpha.diff patch -p1 < font2.diff make clean install ```Run this script after each update to the original repository.
Problem: Font looks blurry or wrong size. Solution: Ensure your font string uses exact X Logical Font Description (XLFD) syntax, e.g., `"--monospace-----12-------"`. Alternatively, use Xft fonts with `"monospace:size=12"`.
Problem: Copy-paste doesn't work between applications. Solution: Apply the `clipboard` patch to sync `st`'s selection with the system clipboard. Without it, `st` only uses the primary selection (middle-click paste).
Problem: Terminal doesn't render Unicode characters. Solution: Apply the `font2` patch and specify a fallback font like `"Noto Color Emoji:size=12"` in `config.h`.
`st` is not for everyone. It demands time investment in exchange for speed, efficiency, and complete control. If you value a terminal that uses negligible resources, stays out of your way, and lets you decide exactly what features it has, `st` is an excellent choice. Start with the basic installation, add the scrollback patch, and gradually expand as you identify needs. Over time, you'll build a terminal that perfectly fits your workflow—and you'll understand every line of code that makes it work.