How To Use St: A Practical Guide To The Simple Terminal

29 June 2026, 01:11

The `st` (simple terminal) is a lightweight, X11-based terminal emulator designed for users who prioritize speed, minimalism, and efficiency. Unlike feature-heavy terminals like GNOME Terminal or Konsole, `st` focuses on doing one thing well: rendering a terminal session with minimal overhead. This guide will walk you through installation, configuration, customization, and advanced usage, ensuring you can harness its full potential.

`st` is developed by the suckless.org community, known for their commitment to simplicity, clarity, and frugality. The terminal is written in C and relies on Xft for font rendering and Xlib for basic window management. Its default configuration is deliberately sparse, encouraging users to modify the source code directly rather than relying on bloated configuration files. This approach results in a binary that is often under 20KB, making it ideal for resource-constrained systems or users who value a distraction-free environment.

Most Linux distributions include `st` in their repositories. Install it using your package manager:
  • Debian/Ubuntu: `sudo apt install st`
  • Arch Linux: `sudo pacman -S st`
  • Fedora: `sudo dnf install st`
  • For maximum control, compile `st` from its source code. This allows you to apply patches and customize features before installation.

    1. Clone the repository: ```bash git clone https://git.suckless.org/st cd st ```

    2. Review the configuration: Open `config.def.h` in a text editor. This file contains all default settings, including fonts, colors, keybindings, and terminal options.

    3. Make changes: Edit `config.def.h` to suit your preferences (see Configuration section below). After editing, rename it to `config.h`: ```bash cp config.def.h config.h ```

    4. Build and install: ```bash sudo make clean install ```

    `st` uses a `config.h` file for all settings. Since it is compiled directly into the binary, any change requires recompilation. Below are key parameters you may want to adjust.

    Set your preferred font and size. For example: ```c static charfont = "JetBrains Mono:size=12:antialias=true:autohint=true"; ``` You can specify fallback fonts by separating them with commas.

    Define terminal colors using hexadecimal values. The default scheme is a dark background with light text. To change the color of specific elements, modify the `colorname` array: ```c static const charcolorname[] = { "#282828", /background/ "#ebdbb2", /foreground/ /16 additional colors for ANSI codes/ }; ```

    By default, `st` does not provide scrollback. To enable it, you must apply a patch (see Advanced Customization). However, you can adjust the default buffer size in `config.h`: ```c static int scrollback = 1000; /lines/ ```

    `st` relies heavily on keyboard shortcuts. Understanding these will significantly improve your workflow.

    | Keybinding | Action | ||| | `Ctrl+Shift+c` | Copy selected text | | `Ctrl+Shift+v` | Paste clipboard content | | `Ctrl+Shift+Up` | Scroll up (if scrollback is enabled) | | `Ctrl+Shift+Down` | Scroll down | | `Alt+Shift+[1-9]` | Switch between windows (if using tabbed or multiple instances) | | `Ctrl+Shift+PageUp` | Increase font size | | `Ctrl+Shift+PageDown` | Decrease font size | | `Ctrl+Shift+Home` | Reset font size to default |

    To customize these keybindings, edit the `shortcuts` array in `config.h`. For example, to change the copy shortcut to `Ctrl+Shift+c`: ```c { MODKEY|ShiftMask, XK_c, selcopy, {.i = 0} }, ```

    The true power of `st` lies in its patch system. Patches add features like scrollback, ligature support, or clipboard integration without bloating the core. Popular patches include:

  • scrollback: Enables mouse wheel and keyboard scrolling.
  • ligatures: Renders character ligatures for fonts like Fira Code.
  • anysize: Allows the terminal to resize dynamically.
  • externalpipe: Sends terminal output to external programs (e.g., for URL opening).
  • 1. Download the patch from the suckless patch repository. 2. Apply it with: ```bash patch -p1 < /path/to/patch.diff ``` 3. Rebuild and install: ```bash sudo make clean install ```

    Important: Patches may conflict with each other. Always test one patch at a time and review the diff before applying.

    `st` supports mouse interaction for text selection. Hold the left mouse button to select text, then use `Ctrl+Shift+c` to copy. Middle-click pastes the primary selection (X11 clipboard).

    Since `st` lacks built-in session management, pair it with `tmux` for persistent sessions, split panes, and window management. This combination provides a lightweight yet powerful terminal environment.

    For features like URL opening, use the `externalpipe` patch to pipe output to a script. Example script to open URLs: ```bash #!/bin/sh xurls | dmenu | xargs -r firefox ```

    You can override certain settings when launching `st` from the command line: ```bash st -f "Monospace:size=14" -e bash ``` This starts `st` with a 14pt Monospace font and runs `bash` as the shell.

    Ensure you have the required font installed. Use `fc-list | grep "FontName"` to verify. If glyphs are missing, install a font package like `fonts-jetbrains-mono` or `fonts-noto`.

    Check that X11 is running and `st` has the necessary permissions. Run `st` from a terminal to see error messages. Common causes include missing Xlib libraries or incorrect font paths.

    `st` uses X11 selections. Ensure you are using `Ctrl+Shift+c` and `Ctrl+Shift+v`, not the standard `Ctrl+c` (which sends SIGINT). If using Wayland, consider `st` compiled with XWayland support.

    `st` is a terminal for users who value speed, simplicity, and control. By investing time in configuring and patching it, you gain a tool that perfectly aligns with your workflow. Start with the default build, experiment with patches, and gradually shape it into your ideal terminal. Remember that every change requires recompilation, so maintain a backup of your `config.h` and patches. With practice, `st` becomes an indispensable part of a minimalist, high-efficiency computing environment.

    Products Show

    Product Catalogs

    WhatsApp