From ArchWiki
Revision as of 17:53, 5 December 2017 by Lothar m (talk | contribs) (Colors: added info about the solarized version of St)
Jump to navigation Jump to search

st is a simple terminal implementation for by suckless. It is intended to serve as a lightweight replacement for xterm or urxvt. It currently supports 256 colors, true colors, most VT10X escape sequences, UTF-8, X11 copy/paste, anti-aliased fonts (using fontconfig), fallback fonts, resizing, shortcuts via config.h, and line drawing.


Install the st-gitAUR package.


st is configured through its config.h file, which is copied over from config.h at compile time. A default config.def.h is included with the source.

Consider maintaining your own PKGBUILD with your config.h.


To change the default shell for st, edit this line:

 static char shell[] = "/bin/sh";


To change the terminal type, edit this line:

 static char termname[] = "st-256color";

st will set the TERM variable with the value of termname.

Note: If you experience trouble with st, you can try to set termname to xterm or xterm-256color


Edit the following line as you prefer:

static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";

You can also pass the value of the font in the command line:

$ st -f "Liberation Mono:size=12"


Edit the following lines to set foreground, background, and cursor colors:

 static unsigned int defaultfg = 7;
 static unsigned int defaultbg = 0;
 static unsigned int defaultcs = 256;

The values refer to the *colorname[] array in the same file; you can use default color or add yours in #rrggbb, for example:

 static const char *colorname[] = {
   	/* 8 normal colors */
       /* 8 bright colors */
       [255] = 0,
       /* more colors can be added after 255 to use with DefaultXX */
  * Default colors (colorname index)
  * foreground, background, cursor
 static unsigned int defaultfg = 257;
 static unsigned int defaultbg = 258;
 static unsigned int defaultcs = 256;

Tools exists to facilitate the creation of color palettes. e.g. that has a set of pre-made ones and exports directly to the st config format.

For those wanting the solarized color scheme, there is a patch that implements it at - AUR version here.

Desktop entry

To simplify launching st with a decent font e.g. adobe-source-code-pro-fonts, you can also create a desktop entry:

[Desktop Entry]
Name=Simple Terminal
Comment=standard terminal emulator for the X window system
Exec=st -t "Suckless Terminal" -f "Source Code Pro:style=Semibold:size=12" -g "80x24"

The menu entry will appear as Simple Terminal in the System Tools application list.



DEL-Key not working properly in some Application

add following to ~/.inputrc or /etc/inputrc:

 set enable-keypad on


The background colour of text in vim will not fill in anything that is not a character

Try setting the value of termname in your config.h to st-256color and recompiling. And do not set the TERM var in your shell, at least not to st-256color as this seems to cause the issue.

Another solution, perhaps a better one, is to have the following lines in your .vimrc file:

if &term =~ '256color'
    " disable Background Color Erase (BCE) so that color schemes
    " render properly when inside 256-color tmux and GNU screen.
    " see also
    set t_ut=

See also