Compare commits
52 Commits
Author | SHA1 | Date | |
---|---|---|---|
80a46b1270 | |||
664c40f6bc | |||
6cd5c3dab7 | |||
8ebab41592 | |||
1ec0515e75 | |||
adf5d2e32a | |||
62d380947e | |||
5705e5dfd1 | |||
45971204a2 | |||
e478f91c10 | |||
284430538d | |||
c7ed0d1bad | |||
ae0966484c | |||
156ce77645 | |||
96c22e1604 | |||
281174445b | |||
197c466864 | |||
5ca0d3d2fa | |||
b1b9dc7eb5 | |||
44c83397af | |||
7c350025b2 | |||
4a421ffbbc | |||
62a92ca1aa | |||
98042a1a2d | |||
5c6df8b3c3 | |||
43a4c5ebb2 | |||
bf2e23f535 | |||
5d1c52bf5c | |||
54adc7ee50 | |||
e2809f3976 | |||
ce547d3060 | |||
4259a3ba3a | |||
fb32d01a18 | |||
986670d080 | |||
6eaec4732f | |||
2edb412b6b | |||
bf6a11a482 | |||
a05423cb6a | |||
cdd993c39e | |||
a7f4af0139 | |||
225fc7cbcf | |||
9760a7a831 | |||
9a3cc64f9d | |||
3d0eeac7a8 | |||
31ba817cc3 | |||
e4dd367a4f | |||
043fb982c5 | |||
7f3ea64d61 | |||
d343f5847b | |||
55c8d82eb1 | |||
d679267c46 | |||
bdd3246271 |
3
.hgtags
Normal file
3
.hgtags
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
cbc18c988236c63a58ed24031805e8d36a3ad01a 0.1
|
||||||
|
f245ac2efd8ac2f1ac6bffae876c2663e794f79d 0.1.1
|
||||||
|
3c2f9f2ab5e433db1401047760ec31d66939b74b 0.2
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
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) 2009, Anselm R Garbe <garbeam at gmail dot com>
|
Copyright (c) 2009, Anselm R Garbe <garbeam at gmail dot com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
9
README
9
README
@ -21,7 +21,14 @@ necessary as root):
|
|||||||
|
|
||||||
Running st
|
Running st
|
||||||
----------
|
----------
|
||||||
See the man page for details.
|
If you don't install st, define TNAME to "xterm" in config.h or make sure to at
|
||||||
|
least compile st terminfo entry with the following command:
|
||||||
|
|
||||||
|
tic -s st.info
|
||||||
|
|
||||||
|
It should print the path of the compiled terminfo entry. You can
|
||||||
|
safely remove it if you don't plan to use st anymore.
|
||||||
|
See the man page for additional details.
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
-------
|
-------
|
||||||
|
17
TODO
17
TODO
@ -9,7 +9,18 @@ code & interface
|
|||||||
----------------
|
----------------
|
||||||
|
|
||||||
* clean selection code
|
* clean selection code
|
||||||
* use the real x11 clipboard
|
* clean and complete terminfo entry
|
||||||
* clean terminfo entry
|
* fast drawing
|
||||||
* utf8
|
|
||||||
* ...
|
* ...
|
||||||
|
|
||||||
|
bugs
|
||||||
|
----
|
||||||
|
|
||||||
|
* handle XOpenMI() errors
|
||||||
|
* fix shift up/down (shift selection in emacs)
|
||||||
|
|
||||||
|
misc
|
||||||
|
----
|
||||||
|
|
||||||
|
$ grep -nE 'XXX|TODO' st.c
|
||||||
|
|
||||||
|
87
config.def.h
87
config.def.h
@ -1,12 +1,16 @@
|
|||||||
#define TAB 8
|
|
||||||
#define TNAME "st-256color"
|
|
||||||
#define FONT "-*-*-medium-r-*-*-*-120-75-75-*-60-*-*"
|
#define FONT "-*-*-medium-r-*-*-*-120-75-75-*-60-*-*"
|
||||||
#define BOLDFONT "-*-*-bold-r-*-*-*-120-75-75-*-60-*-*"
|
#define BOLDFONT "-*-*-bold-r-*-*-*-120-75-75-*-60-*-*"
|
||||||
|
|
||||||
|
/* Space in pixels around the terminal buffer */
|
||||||
#define BORDER 2
|
#define BORDER 2
|
||||||
|
|
||||||
|
/* Default shell to use if SHELL is not set in the env */
|
||||||
#define SHELL "/bin/sh"
|
#define SHELL "/bin/sh"
|
||||||
|
|
||||||
/* Terminal colors */
|
/* Terminal colors (16 first used in escape sequence) */
|
||||||
static const char *colorname[] = {
|
static const char *colorname[] = {
|
||||||
|
/* 8 normal colors */
|
||||||
"black",
|
"black",
|
||||||
"red3",
|
"red3",
|
||||||
"green3",
|
"green3",
|
||||||
@ -15,6 +19,8 @@ static const char *colorname[] = {
|
|||||||
"magenta3",
|
"magenta3",
|
||||||
"cyan3",
|
"cyan3",
|
||||||
"gray90",
|
"gray90",
|
||||||
|
|
||||||
|
/* 8 bright colors */
|
||||||
"gray50",
|
"gray50",
|
||||||
"red",
|
"red",
|
||||||
"green",
|
"green",
|
||||||
@ -22,38 +28,55 @@ static const char *colorname[] = {
|
|||||||
"#5c5cff",
|
"#5c5cff",
|
||||||
"magenta",
|
"magenta",
|
||||||
"cyan",
|
"cyan",
|
||||||
"white"
|
"white",
|
||||||
|
|
||||||
|
[255] = 0,
|
||||||
|
|
||||||
|
/* more colors can be added after 255 to use with DefaultXX */
|
||||||
|
"#cccccc",
|
||||||
|
"#333333",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Default colors (colorname index) */
|
/* Default colors (colorname index)
|
||||||
/* foreground, background, cursor */
|
foreground, background, cursor, unfocused cursor */
|
||||||
#define DefaultFG 7
|
#define DefaultFG 7
|
||||||
#define DefaultBG 0
|
#define DefaultBG 0
|
||||||
#define DefaultCS 1
|
#define DefaultCS 256
|
||||||
|
#define DefaultUCS 257
|
||||||
|
|
||||||
/* Special keys */
|
/* 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 */
|
||||||
static Key key[] = {
|
static Key key[] = {
|
||||||
{ XK_BackSpace, "\177" },
|
{ XK_BackSpace, XK_NO_MOD, "\177" },
|
||||||
{ XK_Insert, "\033[2~" },
|
{ XK_Insert, XK_NO_MOD, "\033[2~" },
|
||||||
{ XK_Delete, "\033[3~" },
|
{ XK_Delete, XK_NO_MOD, "\033[3~" },
|
||||||
{ XK_Home, "\033[1~" },
|
{ XK_Home, XK_NO_MOD, "\033[1~" },
|
||||||
{ XK_End, "\033[4~" },
|
{ XK_End, XK_NO_MOD, "\033[4~" },
|
||||||
{ XK_Prior, "\033[5~" },
|
{ XK_Prior, XK_NO_MOD, "\033[5~" },
|
||||||
{ XK_Next, "\033[6~" },
|
{ XK_Next, XK_NO_MOD, "\033[6~" },
|
||||||
{ XK_F1, "\033OP" },
|
{ XK_F1, XK_NO_MOD, "\033OP" },
|
||||||
{ XK_F2, "\033OQ" },
|
{ XK_F2, XK_NO_MOD, "\033OQ" },
|
||||||
{ XK_F3, "\033OR" },
|
{ XK_F3, XK_NO_MOD, "\033OR" },
|
||||||
{ XK_F4, "\033OS" },
|
{ XK_F4, XK_NO_MOD, "\033OS" },
|
||||||
{ XK_F5, "\033[15~" },
|
{ XK_F5, XK_NO_MOD, "\033[15~" },
|
||||||
{ XK_F6, "\033[17~" },
|
{ XK_F6, XK_NO_MOD, "\033[17~" },
|
||||||
{ XK_F7, "\033[18~" },
|
{ XK_F7, XK_NO_MOD, "\033[18~" },
|
||||||
{ XK_F8, "\033[19~" },
|
{ XK_F8, XK_NO_MOD, "\033[19~" },
|
||||||
{ XK_F9, "\033[20~" },
|
{ XK_F9, XK_NO_MOD, "\033[20~" },
|
||||||
{ XK_F10, "\033[21~" },
|
{ XK_F10, XK_NO_MOD, "\033[21~" },
|
||||||
{ XK_F11, "\033[23~" },
|
{ XK_F11, XK_NO_MOD, "\033[23~" },
|
||||||
{ XK_F12, "\033[24~" },
|
{ XK_F12, XK_NO_MOD, "\033[24~" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Set TERM to this */
|
||||||
|
#define TNAME "st-256color"
|
||||||
|
|
||||||
/* Line drawing characters (sometime specific to each font...) */
|
/* Line drawing characters (sometime specific to each font...) */
|
||||||
static char gfx[] = {
|
static char gfx[] = {
|
||||||
['f'] = 'o',
|
['f'] = 'o',
|
||||||
@ -61,3 +84,9 @@ static char gfx[] = {
|
|||||||
['i'] = '#',
|
['i'] = '#',
|
||||||
[255] = 0,
|
[255] = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* double-click timeout (in milliseconds) between clicks for selection */
|
||||||
|
#define DOUBLECLICK_TIMEOUT 300
|
||||||
|
#define TRIPLECLICK_TIMEOUT (2*DOUBLECLICK_TIMEOUT)
|
||||||
|
|
||||||
|
#define TAB 8
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# st version
|
# st version
|
||||||
VERSION = 0.0
|
VERSION = 0.2.1
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
32
st.1
32
st.1
@ -1,4 +1,4 @@
|
|||||||
.TH ST 1 st-VERSION
|
.TH ST 1 st\-VERSION
|
||||||
.SH NAME
|
.SH NAME
|
||||||
st \- simple terminal
|
st \- simple terminal
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -7,26 +7,32 @@ st \- simple terminal
|
|||||||
.IR class ]
|
.IR class ]
|
||||||
.RB [ \-t
|
.RB [ \-t
|
||||||
.IR title ]
|
.IR title ]
|
||||||
|
.RB [ \-w
|
||||||
|
.IR windowid ]
|
||||||
.RB [ \-v ]
|
.RB [ \-v ]
|
||||||
.RB [ \-e
|
.RB [ \-e
|
||||||
.IR cmd ]
|
.IR command ...]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B st
|
.B st
|
||||||
is a simple terminal emulator.
|
is a simple terminal emulator.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B \-t title
|
.BI \-t " title"
|
||||||
Overrides the default title (st)
|
defines the window title (default 'st').
|
||||||
.TP
|
.TP
|
||||||
.B \-c class
|
.BI \-c " class"
|
||||||
Overrides the default class ($TERM)
|
defines the window class (default $TERM).
|
||||||
|
.TP
|
||||||
|
.BI \-w " windowid"
|
||||||
|
embeds st within the window identified by
|
||||||
|
.I windowid
|
||||||
.TP
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
Prints version information to standard output, then exits.
|
prints version information to stderr, then exits.
|
||||||
.TP
|
.TP
|
||||||
.B \-e cmd [arguments]
|
.BI \-e " program " [ " arguments " "... ]"
|
||||||
Execute cmd instead of the shell. Type your command as you would on your
|
st executes
|
||||||
shell. If this option is used, it
|
.I program
|
||||||
.BI "must be the last"
|
instead of the shell. If this is used it
|
||||||
on the command-line. This is the same behaviour as xterm/rxvt.
|
.B must be the last option
|
||||||
|
on the command line, as in xterm / rxvt.
|
||||||
|
13
st.info
13
st.info
@ -33,8 +33,11 @@ st| simpleterm,
|
|||||||
ed=\E[J,
|
ed=\E[J,
|
||||||
el=\E[K,
|
el=\E[K,
|
||||||
el1=\E[1K,
|
el1=\E[1K,
|
||||||
|
flash=\E[?5h\E[?5l,
|
||||||
|
fsl=^G,
|
||||||
home=\E[H,
|
home=\E[H,
|
||||||
hpa=\E[%i%p1%dG,
|
hpa=\E[%i%p1%dG,
|
||||||
|
hs,
|
||||||
ht=^I,
|
ht=^I,
|
||||||
hts=\EH,
|
hts=\EH,
|
||||||
ich=\E[%p1%d@,
|
ich=\E[%p1%d@,
|
||||||
@ -49,6 +52,10 @@ st| simpleterm,
|
|||||||
kcud1=\E[B,
|
kcud1=\E[B,
|
||||||
kcuf1=\E[C,
|
kcuf1=\E[C,
|
||||||
kcuu1=\E[A,
|
kcuu1=\E[A,
|
||||||
|
kLFT=\E[d,
|
||||||
|
kRIT=\E[c,
|
||||||
|
kind=\E[a,
|
||||||
|
kri=\E[b,
|
||||||
kdch1=\E[3~,
|
kdch1=\E[3~,
|
||||||
kich1=\E[2~,
|
kich1=\E[2~,
|
||||||
kend=\E[4~,
|
kend=\E[4~,
|
||||||
@ -66,17 +73,19 @@ st| simpleterm,
|
|||||||
kf9=\E[20~,
|
kf9=\E[20~,
|
||||||
khome=\E[1~,
|
khome=\E[1~,
|
||||||
knp=\E[6~,
|
knp=\E[6~,
|
||||||
|
kmous=\E[M,
|
||||||
kpp=\E[5~,
|
kpp=\E[5~,
|
||||||
lines#24,
|
lines#24,
|
||||||
mir,
|
mir,
|
||||||
msgr,
|
msgr,
|
||||||
ncv#3,
|
ncv#3,
|
||||||
op=\E[37;40m,
|
op=\E[39;49m,
|
||||||
pairs#64,
|
pairs#64,
|
||||||
rc=\E8,
|
rc=\E8,
|
||||||
rev=\E[7m,
|
rev=\E[7m,
|
||||||
ri=\EM,
|
ri=\EM,
|
||||||
rmacs=\E(B,
|
rmacs=\E(B,
|
||||||
|
rmcup=\E[?1049l,
|
||||||
rmso=\E[m,
|
rmso=\E[m,
|
||||||
rmul=\E[m,
|
rmul=\E[m,
|
||||||
sc=\E7,
|
sc=\E7,
|
||||||
@ -85,9 +94,11 @@ st| simpleterm,
|
|||||||
sgr0=\E[0m,
|
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,
|
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,
|
||||||
smacs=\E(0,
|
smacs=\E(0,
|
||||||
|
smcup=\E[?1049h,
|
||||||
smso=\E[7m,
|
smso=\E[7m,
|
||||||
smul=\E[4m,
|
smul=\E[4m,
|
||||||
tbc=\E[2g,
|
tbc=\E[2g,
|
||||||
|
tsl=\E]0;,
|
||||||
ul,
|
ul,
|
||||||
xenl,
|
xenl,
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user