Compare commits
150 Commits
Author | SHA1 | Date | |
---|---|---|---|
df62d3dab8 | |||
d92ad64017 | |||
dcf0955466 | |||
48389be574 | |||
d84e2978c2 | |||
cb9d92ce51 | |||
32173a11b4 | |||
7168d85f97 | |||
53eda6d525 | |||
91804d7227 | |||
4abecf9ce4 | |||
5de1468554 | |||
ab40392d08 | |||
fa952e1901 | |||
5967a7c0db | |||
d627351429 | |||
976b34d1fc | |||
f0ee36878c | |||
a90662fdcf | |||
852db9e9b0 | |||
a9092bc48b | |||
506b8ea0c6 | |||
3fce3392ac | |||
70aeaf7f2f | |||
ec9fe428b8 | |||
82437818c5 | |||
b86451bf74 | |||
b9f239abe6 | |||
2549840ed7 | |||
0ddbb0c6cc | |||
c1ef12591b | |||
639104946a | |||
5ef7457266 | |||
b5982e284d | |||
a07db5787a | |||
4497d2125c | |||
e496602135 | |||
15cd4ff84a | |||
5e5c3b8cf3 | |||
bcbf5156be | |||
18e2def342 | |||
1ad0b11415 | |||
23d1b03d4e | |||
d8cf33c207 | |||
efe3937183 | |||
2ca5d9463d | |||
33eaeacaa4 | |||
d68253ec75 | |||
71fc293de2 | |||
656c43b4c7 | |||
448a25dbc8 | |||
4dfbf487bf | |||
e2fbd25f51 | |||
57e9f03059 | |||
61ffa628ff | |||
a0b0b8f694 | |||
eb837afafa | |||
3f482f4758 | |||
d181afe094 | |||
9c7579deea | |||
8b0167b596 | |||
5e32f3c2f4 | |||
40be64cff8 | |||
63cab32d05 | |||
cf7edb2641 | |||
8a9c8b7502 | |||
7d54d35a95 | |||
1c316bedce | |||
851b15293a | |||
d41d383aad | |||
6bf6ef46f2 | |||
c624bb5703 | |||
f3704e6553 | |||
9c04eb529f | |||
6b42002e1a | |||
dccba949b5 | |||
30e167c457 | |||
184c38c88b | |||
12516e2181 | |||
81283df211 | |||
42ebd8ef7f | |||
d254935875 | |||
adc4631574 | |||
91d32161fc | |||
04b6bee980 | |||
1e334a1469 | |||
10cb169ede | |||
e5588098c0 | |||
25cdfc8483 | |||
b576d2c551 | |||
f48c2b1484 | |||
fd7f78f2c7 | |||
001b0152a4 | |||
62c5abf2a7 | |||
a683de5364 | |||
d0973d19da | |||
f5c6bcf03a | |||
0e0a7f9130 | |||
c238dbae5f | |||
245a6418b4 | |||
1afbb7799f | |||
76a86e1612 | |||
a9550744b5 | |||
b9567a9b18 | |||
6cd52d6c2f | |||
7815df826a | |||
870be23e28 | |||
1f7896ae9c | |||
ec8262e106 | |||
684a6b59ee | |||
59eaf3ce56 | |||
31c71cddb9 | |||
07c282d229 | |||
e135e96f35 | |||
ee4a9934ab | |||
eeb26ec316 | |||
b3d8986489 | |||
6f336ce8f2 | |||
e2f6df0d17 | |||
7988713b35 | |||
499671f3bf | |||
1da81ff23e | |||
4675c14758 | |||
1175c4be7a | |||
06963a1dc7 | |||
5843cbeae7 | |||
6590664fa0 | |||
e049533ca7 | |||
67d809776f | |||
94ce8a7184 | |||
2d061761f9 | |||
4eeb3aded3 | |||
9e48ff64e2 | |||
5991c6d7d3 | |||
0e2bd2db06 | |||
62c5a5a60a | |||
332c2a22fb | |||
012f7fac29 | |||
80a46b1270 | |||
664c40f6bc | |||
6cd5c3dab7 | |||
8ebab41592 | |||
1ec0515e75 | |||
adf5d2e32a | |||
62d380947e | |||
5705e5dfd1 | |||
45971204a2 | |||
e478f91c10 | |||
284430538d | |||
c7ed0d1bad |
2
.hgtags
2
.hgtags
@ -1,2 +1,4 @@
|
||||
cbc18c988236c63a58ed24031805e8d36a3ad01a 0.1
|
||||
f245ac2efd8ac2f1ac6bffae876c2663e794f79d 0.1.1
|
||||
3c2f9f2ab5e433db1401047760ec31d66939b74b 0.2
|
||||
108926a0fe610b92c0296148721c3225932f39aa 0.2.1
|
||||
|
8
FAQ
Normal file
8
FAQ
Normal file
@ -0,0 +1,8 @@
|
||||
--
|
||||
Why does st not handle utmp entries?
|
||||
|
||||
Use the excellent tool of utmp[0] for this task.
|
||||
|
||||
[0] http://hg.suckless.org/utmp/
|
||||
--
|
||||
|
17
LEGACY
Normal file
17
LEGACY
Normal file
@ -0,0 +1,17 @@
|
||||
A STATEMENT ON LEGACY SUPPORT
|
||||
|
||||
In the terminal world there is much cruft that comes from old and unsup‐
|
||||
ported terminals that inherit incompatible modes and escape sequences
|
||||
which noone is able to know, except when he/she comes from that time and
|
||||
developed a graphical vt100 emulator at that time.
|
||||
|
||||
One goal of st is to only support what is really needed. When you en‐
|
||||
counter a sequence which you really need, implement it. But while you
|
||||
are at it, do not add the other cruft you might encounter while sneek‐
|
||||
ing at other terminal emulators. History has bloated them and there is
|
||||
no real evidence that most of the sequences are used today.
|
||||
|
||||
|
||||
Christoph Lohmann <20h@r-36.net>
|
||||
2012-09-13T07:00:36.081271045+02:00
|
||||
|
4
LICENSE
4
LICENSE
@ -1,4 +1,6 @@
|
||||
Copyright (c) 2009, Aurélien APTEL <aurelien dot aptel at gmail dot com>
|
||||
Copyright (c) 2009-2012, Aurélien APTEL <aurelien dot aptel at gmail dot com>
|
||||
Copyright (c) 2012, Roberto E. Vargas Caballero <k0ga at shike2 dot com>
|
||||
Copyright (c) 2012, Christoph Lohmann <20h at r-36 dot net>
|
||||
Copyright (c) 2009, Anselm R Garbe <garbeam at gmail dot com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
2
Makefile
2
Makefile
@ -48,6 +48,8 @@ install: all
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||
@echo If things do not seem to work, be sure that there is no \
|
||||
floating st terminfo in the .terminfo directory in your home dir.
|
||||
@tic -s st.info
|
||||
|
||||
uninstall:
|
||||
|
24
TODO
24
TODO
@ -1,18 +1,30 @@
|
||||
vt emulation
|
||||
------------
|
||||
|
||||
* screen erased with background color ## capname:bce
|
||||
* back tab ## capname:cbt ## seq:CSI Z
|
||||
* ...
|
||||
* implement BCE right
|
||||
* color definition in CSI
|
||||
* implement CSI parsing
|
||||
* make the keypad keys really work
|
||||
* kf0 .. kf44
|
||||
* kend, kel, kent, kfnd, ked, kext
|
||||
* kNXT, kPRV
|
||||
* ka1, ka3, kb2
|
||||
* add arrow keys handling
|
||||
|
||||
code & interface
|
||||
----------------
|
||||
|
||||
* clean selection code
|
||||
* clean and complete terminfo entry
|
||||
* add fallback fonts for the restricted xft code
|
||||
|
||||
bugs
|
||||
----
|
||||
|
||||
* handle XOpenMI() errors
|
||||
* fix shift up/down (shift selection in emacs)
|
||||
* fast drawing
|
||||
* ...
|
||||
* fix selection paste for xatom STRING
|
||||
* fix umlaut handling in settitle
|
||||
* fix rows and column definition in fixed geometry
|
||||
|
||||
misc
|
||||
----
|
||||
|
79
config.def.h
79
config.def.h
@ -1,12 +1,23 @@
|
||||
#define TAB 8
|
||||
#define TNAME "st-256color"
|
||||
#define FONT "-*-*-medium-r-*-*-*-120-75-75-*-60-*-*"
|
||||
#define BOLDFONT "-*-*-bold-r-*-*-*-120-75-75-*-60-*-*"
|
||||
#define BORDER 2
|
||||
#define SHELL "/bin/sh"
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
|
||||
static unsigned int borderpx = 2;
|
||||
static char shell[] = "/bin/sh";
|
||||
|
||||
/* double-click timeout (in milliseconds) between clicks for selection */
|
||||
static unsigned int doubleclicktimeout = 300;
|
||||
static unsigned int tripleclicktimeout = 600;
|
||||
|
||||
/* TERM value */
|
||||
static char termname[] = "st-256color";
|
||||
|
||||
static unsigned int tabspaces = 8;
|
||||
|
||||
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* 8 normal colors */
|
||||
"black",
|
||||
"red3",
|
||||
"green3",
|
||||
@ -15,6 +26,8 @@ static const char *colorname[] = {
|
||||
"magenta3",
|
||||
"cyan3",
|
||||
"gray90",
|
||||
|
||||
/* 8 bright colors */
|
||||
"gray50",
|
||||
"red",
|
||||
"green",
|
||||
@ -22,26 +35,38 @@ static const char *colorname[] = {
|
||||
"#5c5cff",
|
||||
"magenta",
|
||||
"cyan",
|
||||
"white"
|
||||
"white",
|
||||
|
||||
[255] = 0,
|
||||
|
||||
/* more colors can be added after 255 to use with DefaultXX */
|
||||
"#cccccc",
|
||||
"#333333",
|
||||
};
|
||||
|
||||
/* Default colors (colorname index)
|
||||
foreground, background, cursor */
|
||||
#define DefaultFG 7
|
||||
#define DefaultBG 0
|
||||
#define DefaultCS 1
|
||||
|
||||
/* Special keys (change & recompile st.info accordingly)
|
||||
Keep in mind that kpress() in st.c hardcodes some keys.
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, unfocused cursor
|
||||
*/
|
||||
static unsigned int defaultfg = 7;
|
||||
static unsigned int defaultbg = 0;
|
||||
static unsigned int defaultcs = 256;
|
||||
static unsigned int defaultucs = 257;
|
||||
|
||||
Mask value:
|
||||
* Use XK_ANY_MOD to match the key no matter modifiers state
|
||||
* Use XK_NO_MOD to match the key alone (no modifiers)
|
||||
/*
|
||||
* Special keys (change & recompile st.info accordingly)
|
||||
* Keep in mind that kpress() in st.c hardcodes some keys.
|
||||
*
|
||||
* Mask value:
|
||||
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
||||
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
||||
*/
|
||||
|
||||
key, mask, output */
|
||||
/* key, mask, output */
|
||||
static Key key[] = {
|
||||
{ XK_BackSpace, XK_NO_MOD, "\177" },
|
||||
{ XK_Insert, XK_NO_MOD, "\033[2~" },
|
||||
{ XK_Insert, XK_NO_MOD, "\033[2~" },
|
||||
{ XK_Delete, XK_NO_MOD, "\033[3~" },
|
||||
{ XK_Home, XK_NO_MOD, "\033[1~" },
|
||||
{ XK_End, XK_NO_MOD, "\033[4~" },
|
||||
@ -61,14 +86,12 @@ static Key key[] = {
|
||||
{ XK_F12, XK_NO_MOD, "\033[24~" },
|
||||
};
|
||||
|
||||
/* Line drawing characters (sometime specific to each font...) */
|
||||
static char gfx[] = {
|
||||
['f'] = 'o',
|
||||
['g'] = '+',
|
||||
['i'] = '#',
|
||||
[255] = 0,
|
||||
/* Internal shortcuts. */
|
||||
#define MODKEY Mod1Mask
|
||||
|
||||
static Shortcut shortcuts[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY|ShiftMask, XK_Prior, xzoom, {.i = +1} },
|
||||
{ MODKEY|ShiftMask, XK_Next, xzoom, {.i = -1} },
|
||||
};
|
||||
|
||||
/* double-click timeout (in milliseconds) between clicks for selection */
|
||||
#define DOUBLECLICK_TIMEOUT 300
|
||||
#define TRIPLECLICK_TIMEOUT (2*DOUBLECLICK_TIMEOUT)
|
||||
|
10
config.mk
10
config.mk
@ -1,5 +1,5 @@
|
||||
# st version
|
||||
VERSION = 0.1.1
|
||||
VERSION = 0.3
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
@ -11,13 +11,13 @@ X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# includes and libs
|
||||
INCS = -I. -I/usr/include -I${X11INC}
|
||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil
|
||||
INCS = -I. -I/usr/include -I${X11INC} -I/usr/include/freetype2
|
||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lfontconfig
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -DVERSION=\"${VERSION}\"
|
||||
CFLAGS += -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS += -s ${LIBS}
|
||||
CFLAGS += -g -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS += -g ${LIBS}
|
||||
|
||||
# compiler and linker
|
||||
CC ?= cc
|
||||
|
39
st.1
39
st.1
@ -5,6 +5,12 @@ st \- simple terminal
|
||||
.B st
|
||||
.RB [ \-c
|
||||
.IR class ]
|
||||
.RB [ \-f
|
||||
.IR font ]
|
||||
.RB [ \-g
|
||||
.IR geometry ]
|
||||
.RB [ \-o
|
||||
.IR file ]
|
||||
.RB [ \-t
|
||||
.IR title ]
|
||||
.RB [ \-w
|
||||
@ -17,12 +23,26 @@ st \- simple terminal
|
||||
is a simple terminal emulator.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI \-t " title"
|
||||
defines the window title (default 'st').
|
||||
.TP
|
||||
.BI \-c " class"
|
||||
defines the window class (default $TERM).
|
||||
.TP
|
||||
.BI \-f " font"
|
||||
defines the
|
||||
.I font
|
||||
to use when st is run.
|
||||
.TP
|
||||
.BI \-g " geometry"
|
||||
defines the X11 geometry string, which will fixate the height and width of st.
|
||||
.TP
|
||||
.BI \-o " file"
|
||||
writes all the I/O to
|
||||
.I file.
|
||||
This feature is useful when recording st sessions. A value of "-" means
|
||||
standard output.
|
||||
.TP
|
||||
.BI \-t " title"
|
||||
defines the window title (default 'st').
|
||||
.TP
|
||||
.BI \-w " windowid"
|
||||
embeds st within the window identified by
|
||||
.I windowid
|
||||
@ -36,3 +56,16 @@ st executes
|
||||
instead of the shell. If this is used it
|
||||
.B must be the last option
|
||||
on the command line, as in xterm / rxvt.
|
||||
.SH CUSTOMIZATION
|
||||
.B st
|
||||
can be customized by creating a custom config.h and (re)compiling the source
|
||||
code. This keeps it fast, secure and simple.
|
||||
.SH AUTHORS
|
||||
See the LICENSE file for the authors.
|
||||
.SH LICENSE
|
||||
See the LICENSE file for the terms of redistribution.
|
||||
.SH SEE ALSO
|
||||
.BR tabbed (1)
|
||||
.SH BUGS
|
||||
See the TODO file in the distribution.
|
||||
|
||||
|
18
st.info
18
st.info
@ -33,6 +33,7 @@ st| simpleterm,
|
||||
ed=\E[J,
|
||||
el=\E[K,
|
||||
el1=\E[1K,
|
||||
enacs=\E)0,
|
||||
flash=\E[?5h\E[?5l,
|
||||
fsl=^G,
|
||||
home=\E[H,
|
||||
@ -46,6 +47,7 @@ st| simpleterm,
|
||||
ind=^J,
|
||||
indn=\E[%p1%dS,
|
||||
invis=\E[8m,
|
||||
is2=\E[4l\E>,
|
||||
it#8,
|
||||
kbs=\177,
|
||||
kcub1=\E[D,
|
||||
@ -84,23 +86,33 @@ st| simpleterm,
|
||||
rc=\E8,
|
||||
rev=\E[7m,
|
||||
ri=\EM,
|
||||
ritm=\E[23m,
|
||||
rmacs=\E(B,
|
||||
rmcup=\E[?1049l,
|
||||
rmso=\E[m,
|
||||
# rmkx=\E>,
|
||||
rmso=\E[23m,
|
||||
rmul=\E[m,
|
||||
rs1=\Ec,
|
||||
rs2=\E[4l\E>,
|
||||
sc=\E7,
|
||||
setab=\E[4%p1%dm,
|
||||
setaf=\E[3%p1%dm,
|
||||
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
|
||||
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
|
||||
sgr0=\E[0m,
|
||||
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
|
||||
sitm=\E[3m,
|
||||
smacs=\E(0,
|
||||
smcup=\E[?1049h,
|
||||
smso=\E[7m,
|
||||
# smkx=\E=,
|
||||
smso=\E[3m,
|
||||
smul=\E[4m,
|
||||
tbc=\E[2g,
|
||||
tbc=\E[3g,
|
||||
tsl=\E]0;,
|
||||
ul,
|
||||
xenl,
|
||||
vpa=\E[%i%p1%dd,
|
||||
|
||||
|
||||
st-256color| simpleterm with 256 colors,
|
||||
use=st,
|
||||
|
Reference in New Issue
Block a user