mirror of
git://git.suckless.org/st
synced 2025-07-30 19:52:09 -07:00
Compare commits
367 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
92e092efe6 | ||
|
5f48e89716 | ||
|
bdd649a102 | ||
|
71fa10f613 | ||
|
caa97cc781 | ||
|
c03548750b | ||
|
8e15887de9 | ||
|
89cf0fc597 | ||
|
980991fa6e | ||
|
ae1923d275 | ||
|
38af006b5e | ||
|
c990abfedf | ||
|
3cb7f27afe | ||
|
1811b6030c | ||
|
22571ea4e8 | ||
|
8751809aff | ||
|
765bb0fd14 | ||
|
07ce96a3a0 | ||
|
190b94c7a2 | ||
|
4f21c41a1c | ||
|
3a5053f6c1 | ||
|
7ab6c92e18 | ||
|
0622ad9bad | ||
|
21f765426c | ||
|
753fe862b1 | ||
|
61c35cd246 | ||
|
742a41d655 | ||
|
f36dd277a2 | ||
|
0d7448dabc | ||
|
b17aa18f7c | ||
|
736685d641 | ||
|
89807ed453 | ||
|
84c756b97e | ||
|
2fdcc5e5f6 | ||
|
ab69ea89b7 | ||
|
5528280fae | ||
|
6dc2b546ec | ||
|
c27c731b9f | ||
|
6ee56d6590 | ||
|
215bdb2da3 | ||
|
56abffb4b6 | ||
|
aff35af275 | ||
|
83e73c6242 | ||
|
42fa1f5ce4 | ||
|
23ed12857f | ||
|
9eb70a2d3e | ||
|
9619760e12 | ||
|
a6af2cc469 | ||
|
b94ad75e5d | ||
|
e6dd0f825d | ||
|
b0310fba5d | ||
|
9d1495f9ee | ||
|
c569e3146e | ||
|
39ae1a4de5 | ||
|
6352502d64 | ||
|
b9390a5496 | ||
|
d2937b05ae | ||
|
d3e0f3444b | ||
|
ecac5ee35e | ||
|
93b54cfcc4 | ||
|
6f5f770186 | ||
|
6524f022f7 | ||
|
9305f3c184 | ||
|
5bb90125c8 | ||
|
69d1fe06a9 | ||
|
288f80cb06 | ||
|
c9357a8edf | ||
|
580302f317 | ||
|
246c3481d7 | ||
|
b341e51351 | ||
|
86d1e432a8 | ||
|
c7e24e44c8 | ||
|
5406e655da | ||
|
72d2accc22 | ||
|
2fcfea1bf1 | ||
|
b746816b78 | ||
|
4f60751440 | ||
|
f5075a9e9d | ||
|
c87d45466b | ||
|
28259f5750 | ||
|
adeb2e95d6 | ||
|
9494362d0b | ||
|
cf1fcc4d96 | ||
|
230d0c8428 | ||
|
b0bddc694a | ||
|
487bbb24d0 | ||
|
29619a1a35 | ||
|
b8804f9f67 | ||
|
1b514048b2 | ||
|
3604445ffc | ||
|
ac11bbb03b | ||
|
c5f1d74fd8 | ||
|
7dd24bfb4c | ||
|
aba6c292af | ||
|
4d14d97547 | ||
|
708b697ed7 | ||
|
09f5d98251 | ||
|
4418939dd9 | ||
|
bafbba56cd | ||
|
11625c7166 | ||
|
008aae541b | ||
|
cd159883d1 | ||
|
f9fb620914 | ||
|
86633ada91 | ||
|
dcfe505d3c | ||
|
88429cdcbf | ||
|
0c8feecbf7 | ||
|
a7eef8f230 | ||
|
63a07eb19c | ||
|
dc8c5c82aa | ||
|
c7a945c408 | ||
|
5afb3862ba | ||
|
0392d165d0 | ||
|
98a1085d0e | ||
|
51466e019a | ||
|
c490a60b80 | ||
|
83dea7fd7b | ||
|
e5f6736ee0 | ||
|
a3549c2eec | ||
|
8342036f98 | ||
|
9d9e049eac | ||
|
177d888dff | ||
|
fa04911c91 | ||
|
1926305318 | ||
|
8f3e6a577d | ||
|
f8b4998b32 | ||
|
6530025bca | ||
|
d4a17316d3 | ||
|
20c4f12254 | ||
|
821a6e00a5 | ||
|
8de8ae3923 | ||
|
ec3268961d | ||
|
769d481807 | ||
|
b4dfa18124 | ||
|
e8f3513bf4 | ||
|
f210ea26c4 | ||
|
8306568bd0 | ||
|
844cd7ce17 | ||
|
8c5ba1cfb0 | ||
|
3949aa7c5d | ||
|
84ceefe089 | ||
|
b5d0a13c10 | ||
|
984c12d2a6 | ||
|
da78629cf5 | ||
|
f5356d0185 | ||
|
bcbaf5d9be | ||
|
f796533b1b | ||
|
955923b38b | ||
|
0015e198bf | ||
|
1fc4afd1e6 | ||
|
21bd4f4f9d | ||
|
50e6355e0d | ||
|
77569526c0 | ||
|
19d095717f | ||
|
5edeec1b20 | ||
|
738f555f66 | ||
|
58eaa998b3 | ||
|
c2fd2754eb | ||
|
27b28f1dc2 | ||
|
587b443592 | ||
|
93661042a2 | ||
|
18a05fdf43 | ||
|
5159d55c63 | ||
|
6fd887077e | ||
|
bb6dc33206 | ||
|
2323e962e6 | ||
|
c6fcb78b3a | ||
|
8b4cfcea73 | ||
|
a32c5f5726 | ||
|
ba36d1394b | ||
|
ede83bd08b | ||
|
2411308bd2 | ||
|
d03aa8d20b | ||
|
80d8051269 | ||
|
488977c8ef | ||
|
f4ebb3180f | ||
|
3544e354b2 | ||
|
cf890e5bf0 | ||
|
bdb850a16a | ||
|
e31829f659 | ||
|
5e917ab287 | ||
|
99fb365aa3 | ||
|
870f961c49 | ||
|
1629363f2d | ||
|
6b315558f8 | ||
|
5f91983541 | ||
|
9e3e8ce466 | ||
|
0e439e5624 | ||
|
74962bf566 | ||
|
6681af165b | ||
|
1ae2745fd1 | ||
|
a48f2be7f5 | ||
|
17fa1493ee | ||
|
a8a9e66a7d | ||
|
17290f493b | ||
|
43d74ef362 | ||
|
3764f38fc8 | ||
|
53105cf74f | ||
|
aa35bbd7a1 | ||
|
704d12442e | ||
|
02d2df5790 | ||
|
c4b79b055d | ||
|
7f1e02e4db | ||
|
84f6dbffa5 | ||
|
2d67f99d28 | ||
|
4a8574b439 | ||
|
8f11e1cd03 | ||
|
844c503c80 | ||
|
1b0b9759dc | ||
|
99d2d6007a | ||
|
fe31a3f634 | ||
|
6b7f63bac5 | ||
|
80b32af794 | ||
|
16ac85bf54 | ||
|
fe527aa508 | ||
|
3afdb4ff04 | ||
|
f9dc374ea0 | ||
|
fa19f241a3 | ||
|
df1810dd8f | ||
|
ed855ea432 | ||
|
68d97457ec | ||
|
49672dac7b | ||
|
f21e47f44a | ||
|
87abc7cd59 | ||
|
1388870331 | ||
|
6b56cbf9cc | ||
|
3269bf213d | ||
|
4ad2fc7f18 | ||
|
dc74c4f729 | ||
|
b8d6171cb0 | ||
|
ebb6e03201 | ||
|
f27b44b7c2 | ||
|
3cb80840db | ||
|
c46d929fe1 | ||
|
0baf2d8be5 | ||
|
62f9142478 | ||
|
a495fce128 | ||
|
6f4cfa5136 | ||
|
672e4e4b03 | ||
|
45b808b88e | ||
|
71328cbcdc | ||
|
85f8a414be | ||
|
78f8843bc7 | ||
|
96c230e476 | ||
|
6166a1afc8 | ||
|
cf332a325d | ||
|
1584956a60 | ||
|
d2ec39f0ef | ||
|
1f0d981bd7 | ||
|
cdb3b1892a | ||
|
315b7ee9ce | ||
|
c2026a4950 | ||
|
6521b5dc32 | ||
|
a8d5870073 | ||
|
21d905c076 | ||
|
9523233e25 | ||
|
d2173cd716 | ||
|
9559100130 | ||
|
c0a56ef4be | ||
|
9df9a4723d | ||
|
e8dba89164 | ||
|
33da67dac0 | ||
|
d60ee7337b | ||
|
ef1dc9fc4b | ||
|
6162d63151 | ||
|
fb8e3f67f7 | ||
|
39f28b18b7 | ||
|
2738592de6 | ||
|
08a3eea571 | ||
|
53474391bc | ||
|
1fe0a5f39a | ||
|
4435e0ee67 | ||
|
7263820759 | ||
|
1fa27b93f9 | ||
|
3d3c37bc70 | ||
|
489982d4b8 | ||
|
297c886b72 | ||
|
0f6942cdf6 | ||
|
8e577322a3 | ||
|
939e149544 | ||
|
02ae3ce6fd | ||
|
7a4eefe87c | ||
|
c5c2365ab7 | ||
|
62ab938965 | ||
|
2b1bc8087f | ||
|
eeae9b0cee | ||
|
8ac0a5f872 | ||
|
eae31a532e | ||
|
cc2ea3147a | ||
|
bef599bb27 | ||
|
210dda9570 | ||
|
a4358a1fbd | ||
|
4245ba0d12 | ||
|
f3d438b101 | ||
|
587bc939f6 | ||
|
8d21ced085 | ||
|
4579693818 | ||
|
347a45c352 | ||
|
22eeda56b7 | ||
|
86c03ddc82 | ||
|
7e3cff33ff | ||
|
aaee0e8b28 | ||
|
8dde8cde41 | ||
|
33ad83d492 | ||
|
40e4d76d22 | ||
|
fbc589d506 | ||
|
6fc471ccc6 | ||
|
8b602a37a6 | ||
|
6e1c7c8afc | ||
|
90c6f055b6 | ||
|
ebbac77d74 | ||
|
7af030c999 | ||
|
5d3318c0c7 | ||
|
369734c80c | ||
|
2cf4f366d6 | ||
|
7530694987 | ||
|
d743b93fda | ||
|
317b785921 | ||
|
405fd89ac1 | ||
|
8315dc4179 | ||
|
b5144100a5 | ||
|
8f1bef0502 | ||
|
8f47c4a4de | ||
|
62502a88e9 | ||
|
678eff6e18 | ||
|
8e968739c3 | ||
|
0c2b513d01 | ||
|
634c247fa7 | ||
|
5938fa9d32 | ||
|
8618386de9 | ||
|
e1458ef467 | ||
|
911ba5674b | ||
|
a53017c8b4 | ||
|
a77b01176a | ||
|
1e09726518 | ||
|
1b2751f5c2 | ||
|
0851f2be2a | ||
|
011c0f9e5b | ||
|
048c54fd5b | ||
|
6b03bb769a | ||
|
db6f796ecf | ||
|
7ea6863208 | ||
|
8037dac847 | ||
|
2bd6afd1c9 | ||
|
b596d6ba3c | ||
|
872a7f18ea | ||
|
3c546ae739 | ||
|
645c1b0afc | ||
|
e5ff746430 | ||
|
da182612b7 | ||
|
b7e6a5c825 | ||
|
3ae0299064 | ||
|
fed9968ba5 | ||
|
0ca0dd8b11 | ||
|
c371fe58a3 | ||
|
44db38a5f8 | ||
|
4de64fa4d2 | ||
|
de4cd2f6af | ||
|
1e7816c202 | ||
|
5dc48af29e | ||
|
5984657c00 | ||
|
4018b2c507 | ||
|
ddd429ea24 | ||
|
684cf55a0d | ||
|
b1813b14d9 | ||
|
580c8bbd46 | ||
|
502911e554 |
146
FAQ
146
FAQ
@@ -1,43 +1,35 @@
|
|||||||
--
|
## Why does st not handle utmp entries?
|
||||||
Why does st not handle utmp entries?
|
|
||||||
|
|
||||||
Use the excellent tool of utmp[0] for this task.
|
Use the excellent tool of [utmp](http://git.suckless.org/utmp/) for this task.
|
||||||
|
|
||||||
[0] http://git.suckless.org/utmp/
|
## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever!
|
||||||
--
|
|
||||||
Some _random program_ complains that st is unknown/not
|
|
||||||
recognised/unsupported/whatever!
|
|
||||||
|
|
||||||
It means that st doesn’t have any terminfo entry on your system. Chances are
|
It means that st doesn’t have any terminfo entry on your system. Chances are
|
||||||
you did not make install. If you just want to test it without installing it,
|
you did not `make install`. If you just want to test it without installing it,
|
||||||
you can manualy run tic -s st.info in st dir. It will compile st.info into a
|
you can manualy run `tic -s st.info`.
|
||||||
fully working local terminfo description. You can delete it when you’re done.
|
|
||||||
--
|
## Nothing works, and nothing is said about an unknown terminal!
|
||||||
Nothing works, and nothing is said about an unknown terminal!
|
|
||||||
|
|
||||||
* Some programs just assume they’re running in xterm i.e. they don’t rely on
|
* Some programs just assume they’re running in xterm i.e. they don’t rely on
|
||||||
terminfo. What you see is the current state of the “xterm compliance”.
|
terminfo. What you see is the current state of the “xterm compliance”.
|
||||||
* Some programs don’t complain about the lacking st description and default to
|
* Some programs don’t complain about the lacking st description and default to
|
||||||
another terminal. In that case see the question about terminfo.
|
another terminal. In that case see the question about terminfo.
|
||||||
--
|
|
||||||
I get some weird glitches/visual bug on _random program_!
|
|
||||||
|
|
||||||
Try lauching it with a different TERM: $ TERM=xterm myapp. toe(1) will give
|
## I get some weird glitches/visual bug on _random program_!
|
||||||
you a list of available terminals, but you’ll most likely switch between
|
|
||||||
xterm, st or st-256color. The default value for TERM can be changed in
|
|
||||||
config.h (TNAME).
|
|
||||||
--
|
|
||||||
How do I scroll back up?
|
|
||||||
|
|
||||||
Invoke st with a screen multiplexer like GNU screen[0] or tmux[1].
|
Try launching it with a different TERM: $ TERM=xterm myapp. toe(1) will give
|
||||||
st -e screen works better for text reflowing. To enter screen’s scroll
|
you a list of available terminals, but you’ll most likely switch between xterm,
|
||||||
back mode aka “copy mode”, it’s C-a ESC. You probably want defscrollback
|
st or st-256color. The default value for TERM can be changed in config.h
|
||||||
10000 in your ~/.screenrc too.
|
(TNAME).
|
||||||
|
|
||||||
[0] http://en.wikipedia.org/wiki/GNU_Screen
|
## How do I scroll back up?
|
||||||
[1] http://en.wikipedia.org/wiki/Tmux
|
|
||||||
--
|
Using a terminal multiplexer.
|
||||||
Why doesn't the Del key work in some programs?
|
|
||||||
|
* `st -e tmux` using C-b [
|
||||||
|
* `st -e screen` using C-a ESC
|
||||||
|
|
||||||
|
## Why doesn't the Del key work in some programs?
|
||||||
|
|
||||||
Taken from the terminfo manpage:
|
Taken from the terminfo manpage:
|
||||||
|
|
||||||
@@ -45,23 +37,23 @@ Taken from the terminfo manpage:
|
|||||||
are pressed, this information can be given. Note that it is not
|
are pressed, this information can be given. Note that it is not
|
||||||
possible to handle terminals where the keypad only works in
|
possible to handle terminals where the keypad only works in
|
||||||
local (this applies, for example, to the unshifted HP 2621 keys).
|
local (this applies, for example, to the unshifted HP 2621 keys).
|
||||||
If the keypad can be set to transmit or not transmit, tive these
|
If the keypad can be set to transmit or not transmit, give these
|
||||||
codes as smkx and rmkx. Otherwise the keypad is assumed to
|
codes as smkx and rmkx. Otherwise the keypad is assumed to
|
||||||
always transmit.
|
always transmit.
|
||||||
|
|
||||||
In the st case smkx=\E[?1h\E= and rmkx=\E[?1l\E>, so it is mandatory that
|
In the st case smkx=E[?1hE= and rmkx=E[?1lE>, so it is mandatory that
|
||||||
applications which want to test against keypad keys, have to send these
|
applications which want to test against keypad keys send these
|
||||||
sequences.
|
sequences.
|
||||||
|
|
||||||
But buggy applications like bash and irssi for example don't do this. A fast
|
But buggy applications (like bash and irssi, for example) don't do this. A fast
|
||||||
solution for them is to use the following command:
|
solution for them is to use the following command:
|
||||||
|
|
||||||
$ printf "\033?1h\033=" >/dev/tty
|
$ printf '\033[?1h\033=' >/dev/tty
|
||||||
|
|
||||||
or
|
or
|
||||||
$ echo $(tput smkx) >/dev/tty
|
$ tput smkx
|
||||||
|
|
||||||
In the case of bash readline is used. Readline has a different note in its
|
In the case of bash, readline is used. Readline has a different note in its
|
||||||
manpage about this issue:
|
manpage about this issue:
|
||||||
|
|
||||||
enable-keypad (Off)
|
enable-keypad (Off)
|
||||||
@@ -73,7 +65,7 @@ Adding this option to your .inputrc will fix the keypad problem for all
|
|||||||
applications using readline.
|
applications using readline.
|
||||||
|
|
||||||
If you are using zsh, then read the zsh FAQ
|
If you are using zsh, then read the zsh FAQ
|
||||||
(http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25):
|
<http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25>:
|
||||||
|
|
||||||
It should be noted that the O / [ confusion can occur with other keys
|
It should be noted that the O / [ confusion can occur with other keys
|
||||||
such as Home and End. Some systems let you query the key sequences
|
such as Home and End. Some systems let you query the key sequences
|
||||||
@@ -91,5 +83,85 @@ If you are using zsh, then read the zsh FAQ
|
|||||||
zle -N zle-line-finish
|
zle -N zle-line-finish
|
||||||
|
|
||||||
Putting these lines into your .zshrc will fix the problems.
|
Putting these lines into your .zshrc will fix the problems.
|
||||||
--
|
|
||||||
|
## How can I use meta in 8bit mode?
|
||||||
|
|
||||||
|
St supports meta in 8bit mode, but the default terminfo entry doesn't
|
||||||
|
use this capability. If you want it, you have to use the 'st-meta' value
|
||||||
|
in TERM.
|
||||||
|
|
||||||
|
## I cannot compile st in OpenBSD
|
||||||
|
|
||||||
|
OpenBSD lacks librt, despite it being mandatory in POSIX
|
||||||
|
<http://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html#tag_20_11_13>.
|
||||||
|
If you want to compile st for OpenBSD you have to remove -lrt from config.mk, and
|
||||||
|
st will compile without any loss of functionality, because all the functions are
|
||||||
|
included in libc on this platform.
|
||||||
|
|
||||||
|
## The Backspace Case
|
||||||
|
|
||||||
|
St is emulating the Linux way of handling backspace being delete and delete being
|
||||||
|
backspace.
|
||||||
|
|
||||||
|
This is an issue that was discussed in suckless mailing list
|
||||||
|
<http://lists.suckless.org/dev/1404/20697.html>. Here is why some old grumpy
|
||||||
|
terminal users wants its backspace to be how he feels it:
|
||||||
|
|
||||||
|
Well, I am going to comment why I want to change the behaviour
|
||||||
|
of this key. When ASCII was defined in 1968, communication
|
||||||
|
with computers was done using punched cards, or hardcopy
|
||||||
|
terminals (basically a typewriter machine connected with the
|
||||||
|
computer using a serial port). ASCII defines DELETE as 7F,
|
||||||
|
because, in punched-card terms, it means all the holes of the
|
||||||
|
card punched; it is thus a kind of 'physical delete'. In the
|
||||||
|
same way, the BACKSPACE key was a non-destructive backspace,
|
||||||
|
as on a typewriter. So, if you wanted to delete a character,
|
||||||
|
you had to BACKSPACE and then DELETE. Another use of BACKSPACE
|
||||||
|
was to type accented characters, for example 'a BACKSPACE `'.
|
||||||
|
The VT100 had no BACKSPACE key; it was generated using the
|
||||||
|
CONTROL key as another control character (CONTROL key sets to
|
||||||
|
0 b7 b6 b5, so it converts H (code 0x48) into BACKSPACE (code
|
||||||
|
0x08)), but it had a DELETE key in a similar position where
|
||||||
|
the BACKSPACE key is located today on common PC keyboards.
|
||||||
|
All the terminal emulators emulated the difference between
|
||||||
|
these keys correctly: the backspace key generated a BACKSPACE
|
||||||
|
(^H) and delete key generated a DELETE (^?).
|
||||||
|
|
||||||
|
But a problem arose when Linus Torvalds wrote Linux. Unlike
|
||||||
|
earlier terminals, the Linux virtual terminal (the terminal
|
||||||
|
emulator integrated in the kernel) returned a DELETE when
|
||||||
|
backspace was pressed, due to the VT100 having a DELETE key in
|
||||||
|
the same position. This created a lot of problems (see [1]
|
||||||
|
and [2]). Since Linux has become the king, a lot of terminal
|
||||||
|
emulators today generate a DELETE when the backspace key is
|
||||||
|
pressed in order to avoid problems with Linux. The result is
|
||||||
|
that the only way of generating a BACKSPACE on these systems
|
||||||
|
is by using CONTROL + H. (I also think that emacs had an
|
||||||
|
important point here because the CONTROL + H prefix is used
|
||||||
|
in emacs in some commands (help commands).)
|
||||||
|
|
||||||
|
From point of view of the kernel, you can change the key
|
||||||
|
for deleting a previous character with stty erase. When you
|
||||||
|
connect a real terminal into a machine you describe the type
|
||||||
|
of terminal, so getty configures the correct value of stty
|
||||||
|
erase for this terminal. In the case of terminal emulators,
|
||||||
|
however, you don't have any getty that can set the correct
|
||||||
|
value of stty erase, so you always get the default value.
|
||||||
|
For this reason, it is necessary to add 'stty erase ^H' to your
|
||||||
|
profile if you have changed the value of the backspace key.
|
||||||
|
Of course, another solution is for st itself to modify the
|
||||||
|
value of stty erase. I usually have the inverse problem:
|
||||||
|
when I connect to non-Unix machines, I have to press CONTROL +
|
||||||
|
h to get a BACKSPACE. The inverse problem occurs when a user
|
||||||
|
connects to my Unix machines from a different system with a
|
||||||
|
correct backspace key.
|
||||||
|
|
||||||
|
[1] http://www.ibb.net/~anne/keyboard.html
|
||||||
|
[2] http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html
|
||||||
|
|
||||||
|
## But I really want the old grumpy behaviour of my terminal
|
||||||
|
|
||||||
|
Apply [1].
|
||||||
|
|
||||||
|
[1] http://st.suckless.org/patches/delkey
|
||||||
|
|
||||||
|
13
LICENSE
13
LICENSE
@@ -1,9 +1,16 @@
|
|||||||
MIT/X Consortium License
|
MIT/X Consortium License
|
||||||
|
|
||||||
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com>
|
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com>
|
||||||
© 2012 Roberto E. Vargas Caballero <k0ga at shike2 dot com>
|
|
||||||
© 2012 Christoph Lohmann <20h at r-36 dot net>
|
|
||||||
© 2009 Anselm R Garbe <garbeam at gmail dot com>
|
© 2009 Anselm R Garbe <garbeam at gmail dot com>
|
||||||
|
© 2012-2015 Roberto E. Vargas Caballero <k0ga at shike2 dot com>
|
||||||
|
© 2012-2015 Christoph Lohmann <20h at r-36 dot net>
|
||||||
|
© 2013 Eon S. Jeon <esjeon at hyunmu dot am>
|
||||||
|
© 2013 Alexander Sedov <alex0player at gmail dot com>
|
||||||
|
© 2013 Mark Edgar <medgar123 at gmail dot com>
|
||||||
|
© 2013 Eric Pruitt <eric.pruitt at gmail dot com>
|
||||||
|
© 2013 Michael Forney <mforney at mforney dot org>
|
||||||
|
© 2013-2014 Markus Teich <markus dot teich at stusta dot mhn dot de>
|
||||||
|
© 2014 Laslo Hunhold <dev at frign dot de>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
2
Makefile
2
Makefile
@@ -34,7 +34,7 @@ clean:
|
|||||||
dist: clean
|
dist: clean
|
||||||
@echo creating dist tarball
|
@echo creating dist tarball
|
||||||
@mkdir -p st-${VERSION}
|
@mkdir -p st-${VERSION}
|
||||||
@cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 ${SRC} st-${VERSION}
|
@cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 arg.h ${SRC} st-${VERSION}
|
||||||
@tar -cf st-${VERSION}.tar st-${VERSION}
|
@tar -cf st-${VERSION}.tar st-${VERSION}
|
||||||
@gzip st-${VERSION}.tar
|
@gzip st-${VERSION}.tar
|
||||||
@rm -rf st-${VERSION}
|
@rm -rf st-${VERSION}
|
||||||
|
2
README
2
README
@@ -1,6 +1,6 @@
|
|||||||
st - simple terminal
|
st - simple terminal
|
||||||
--------------------
|
--------------------
|
||||||
st is a simple virtual terminal emulator for X which sucks less.
|
st is a simple terminal emulator for X which sucks less.
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
|
23
TODO
23
TODO
@@ -1,32 +1,25 @@
|
|||||||
vt emulation
|
vt emulation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* color definition in CSI
|
* double-height support
|
||||||
* implement CSI parsing
|
|
||||||
* wide-character support in conjunction with fallback xft code
|
|
||||||
* mouse selection support
|
|
||||||
|
|
||||||
code & interface
|
code & interface
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
* clean and complete terminfo entry
|
|
||||||
* add fallback fonts for the restricted xft code
|
|
||||||
* add a simple way to do multiplexing
|
* add a simple way to do multiplexing
|
||||||
|
|
||||||
|
drawing
|
||||||
|
-------
|
||||||
|
* add diacritics support to xdraws()
|
||||||
|
* switch to a suckless font drawing library
|
||||||
|
* make the font cache simpler
|
||||||
|
* add better support for brightening of the upper colors
|
||||||
|
|
||||||
bugs
|
bugs
|
||||||
----
|
----
|
||||||
|
|
||||||
* fix shift up/down (shift selection in emacs)
|
* fix shift up/down (shift selection in emacs)
|
||||||
* fix selection paste for xatom STRING
|
|
||||||
* fix rows and column definition in fixed geometry
|
|
||||||
* fix -e handling
|
|
||||||
* remove DEC test sequence when appropriate
|
* remove DEC test sequence when appropriate
|
||||||
* reverse cursor when drawin light on light background
|
|
||||||
* text should be readable
|
|
||||||
* When some application outputting long text is run in the shell init scripts,
|
|
||||||
then this text might be stripped to the standard 80x25 due to st running the
|
|
||||||
virtual terminal at first priority. Maybe the vt initialisation could be
|
|
||||||
moved somewhere after knowing the right window size.
|
|
||||||
|
|
||||||
misc
|
misc
|
||||||
----
|
----
|
||||||
|
63
arg.h
Normal file
63
arg.h
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copy me if you can.
|
||||||
|
* by 20h
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ARG_H__
|
||||||
|
#define ARG_H__
|
||||||
|
|
||||||
|
extern char *argv0;
|
||||||
|
|
||||||
|
/* use main(int argc, char *argv[]) */
|
||||||
|
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
||||||
|
argv[0] && argv[0][1]\
|
||||||
|
&& argv[0][0] == '-';\
|
||||||
|
argc--, argv++) {\
|
||||||
|
char argc_;\
|
||||||
|
char **argv_;\
|
||||||
|
int brk_;\
|
||||||
|
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
||||||
|
argv++;\
|
||||||
|
argc--;\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
|
for (brk_ = 0, argv[0]++, argv_ = argv;\
|
||||||
|
argv[0][0] && !brk_;\
|
||||||
|
argv[0]++) {\
|
||||||
|
if (argv_ != argv)\
|
||||||
|
break;\
|
||||||
|
argc_ = argv[0][0];\
|
||||||
|
switch (argc_)
|
||||||
|
|
||||||
|
/* Handles obsolete -NUM syntax */
|
||||||
|
#define ARGNUM case '0':\
|
||||||
|
case '1':\
|
||||||
|
case '2':\
|
||||||
|
case '3':\
|
||||||
|
case '4':\
|
||||||
|
case '5':\
|
||||||
|
case '6':\
|
||||||
|
case '7':\
|
||||||
|
case '8':\
|
||||||
|
case '9'
|
||||||
|
|
||||||
|
#define ARGEND }\
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ARGC() argc_
|
||||||
|
|
||||||
|
#define ARGNUMF(base) (brk_ = 1, estrtol(argv[0], (base)))
|
||||||
|
|
||||||
|
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||||
|
((x), abort(), (char *)0) :\
|
||||||
|
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||||
|
(&argv[0][1]) :\
|
||||||
|
(argc--, argv++, argv[0])))
|
||||||
|
|
||||||
|
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||||
|
(char *)0 :\
|
||||||
|
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||||
|
(&argv[0][1]) :\
|
||||||
|
(argc--, argv++, argv[0])))
|
||||||
|
|
||||||
|
#endif
|
127
config.def.h
127
config.def.h
@@ -8,15 +8,51 @@
|
|||||||
static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
|
static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
|
||||||
static int borderpx = 2;
|
static int borderpx = 2;
|
||||||
static char shell[] = "/bin/sh";
|
static char shell[] = "/bin/sh";
|
||||||
|
static char *utmp = NULL;
|
||||||
|
static char stty_args[] = "stty raw -echo -iexten echonl";
|
||||||
|
|
||||||
/* timeouts (in milliseconds) */
|
/* identification sequence returned in DA and DECID */
|
||||||
|
static char vtiden[] = "\033[?6c";
|
||||||
|
|
||||||
|
/* Kerning / character bounding-box multipliers */
|
||||||
|
static float cwscale = 1.0;
|
||||||
|
static float chscale = 1.0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* word delimiter string
|
||||||
|
*
|
||||||
|
* More advanced example: " `'\"()[]{}"
|
||||||
|
*/
|
||||||
|
static char worddelimiters[] = " ";
|
||||||
|
|
||||||
|
/* selection timeouts (in milliseconds) */
|
||||||
static unsigned int doubleclicktimeout = 300;
|
static unsigned int doubleclicktimeout = 300;
|
||||||
static unsigned int tripleclicktimeout = 600;
|
static unsigned int tripleclicktimeout = 600;
|
||||||
|
|
||||||
|
/* alt screens */
|
||||||
|
static bool allowaltscreen = true;
|
||||||
|
|
||||||
/* frames per second st should at maximum draw to the screen */
|
/* frames per second st should at maximum draw to the screen */
|
||||||
static unsigned int xfps = 60;
|
static unsigned int xfps = 120;
|
||||||
static unsigned int actionfps = 30;
|
static unsigned int actionfps = 30;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
|
||||||
|
* attribute.
|
||||||
|
*/
|
||||||
|
static unsigned int blinktimeout = 800;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* thickness of underline and bar cursors
|
||||||
|
*/
|
||||||
|
static unsigned int cursorthickness = 2;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
|
||||||
|
* it
|
||||||
|
*/
|
||||||
|
static int bellvolume = 0;
|
||||||
|
|
||||||
/* TERM value */
|
/* TERM value */
|
||||||
static char termname[] = "st-256color";
|
static char termname[] = "st-256color";
|
||||||
|
|
||||||
@@ -49,18 +85,16 @@ static const char *colorname[] = {
|
|||||||
|
|
||||||
/* more colors can be added after 255 to use with DefaultXX */
|
/* more colors can be added after 255 to use with DefaultXX */
|
||||||
"#cccccc",
|
"#cccccc",
|
||||||
"#333333",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default colors (colorname index)
|
* Default colors (colorname index)
|
||||||
* foreground, background, cursor, unfocused cursor
|
* foreground, background, cursor
|
||||||
*/
|
*/
|
||||||
static unsigned int defaultfg = 7;
|
static unsigned int defaultfg = 7;
|
||||||
static unsigned int defaultbg = 0;
|
static unsigned int defaultbg = 0;
|
||||||
static unsigned int defaultcs = 256;
|
static unsigned int defaultcs = 256;
|
||||||
static unsigned int defaultucs = 257;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Colors used, when the specific fg == defaultfg. So in reverse mode this
|
* Colors used, when the specific fg == defaultfg. So in reverse mode this
|
||||||
@@ -70,16 +104,30 @@ static unsigned int defaultucs = 257;
|
|||||||
static unsigned int defaultitalic = 11;
|
static unsigned int defaultitalic = 11;
|
||||||
static unsigned int defaultunderline = 7;
|
static unsigned int defaultunderline = 7;
|
||||||
|
|
||||||
/* Internal shortcuts. */
|
/* Internal mouse shortcuts. */
|
||||||
|
/* Beware that overloading Button1 will disable the selection. */
|
||||||
|
static Mousekey mshortcuts[] = {
|
||||||
|
/* button mask string */
|
||||||
|
{ Button4, XK_ANY_MOD, "\031" },
|
||||||
|
{ Button5, XK_ANY_MOD, "\005" },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Internal keyboard shortcuts. */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
|
|
||||||
static Shortcut shortcuts[] = {
|
static Shortcut shortcuts[] = {
|
||||||
/* modifier key function argument */
|
/* mask keysym function argument */
|
||||||
{ MODKEY|ShiftMask, XK_Prior, xzoom, {.i = +1} },
|
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
|
||||||
{ MODKEY|ShiftMask, XK_Next, xzoom, {.i = -1} },
|
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
|
||||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
|
||||||
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} },
|
{ MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} },
|
||||||
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} },
|
{ MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} },
|
||||||
|
{ MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} },
|
||||||
|
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||||
|
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} },
|
||||||
|
{ MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
|
||||||
|
{ MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} },
|
||||||
|
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} },
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -88,12 +136,12 @@ static Shortcut shortcuts[] = {
|
|||||||
* Mask value:
|
* Mask value:
|
||||||
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
||||||
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
||||||
* keypad value:
|
* appkey value:
|
||||||
* * 0: no value
|
* * 0: no value
|
||||||
* * > 0: keypad application mode enabled
|
* * > 0: keypad application mode enabled
|
||||||
* * = 2: term.numlock = 1
|
* * = 2: term.numlock = 1
|
||||||
* * < 0: keypad application mode disabled
|
* * < 0: keypad application mode disabled
|
||||||
* cursor value:
|
* appcursor value:
|
||||||
* * 0: no value
|
* * 0: no value
|
||||||
* * > 0: cursor application mode enabled
|
* * > 0: cursor application mode enabled
|
||||||
* * < 0: cursor application mode disabled
|
* * < 0: cursor application mode disabled
|
||||||
@@ -102,27 +150,32 @@ static Shortcut shortcuts[] = {
|
|||||||
* * > 0: crlf mode is enabled
|
* * > 0: crlf mode is enabled
|
||||||
* * < 0: crlf mode is disabled
|
* * < 0: crlf mode is disabled
|
||||||
*
|
*
|
||||||
* Be careful with the order of the definitons because st searchs in
|
* Be careful with the order of the definitions because st searches in
|
||||||
* this table sequencially, so any XK_ANY_MOD must be in the last
|
* this table sequentially, so any XK_ANY_MOD must be in the last
|
||||||
* position for a key.
|
* position for a key.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you want something else but the function keys of X11 (0xFF00 - 0xFFFF)
|
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
|
||||||
* mapped below, add them to this array.
|
* to be mapped below, add them to this array.
|
||||||
*/
|
*/
|
||||||
static KeySym mappedkeys[] = { -1 };
|
static KeySym mappedkeys[] = { -1 };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Which bits of the state should be ignored. By default the state bit for the
|
* State bits to ignore when matching key or button events. By default,
|
||||||
* keyboard layout (XK_SWITCH_MOD) is ignored.
|
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
|
||||||
*/
|
*/
|
||||||
uint ignoremod = XK_SWITCH_MOD;
|
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
|
||||||
|
|
||||||
|
/* Override mouse-select while mask is active (when MODE_MOUSE is set).
|
||||||
|
* Note that if you want to use ShiftMask with selmasks, set this to an other
|
||||||
|
* modifier, set to 0 to not use it. */
|
||||||
|
static uint forceselmod = ShiftMask;
|
||||||
|
|
||||||
/* key, mask, output, keypad, cursor, crlf */
|
|
||||||
static Key key[] = {
|
static Key key[] = {
|
||||||
/* keysym mask string keypad cursor crlf */
|
/* keysym mask string appkey appcursor crlf */
|
||||||
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, 0, 0},
|
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0},
|
||||||
|
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0},
|
||||||
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
|
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
|
||||||
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
|
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0},
|
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0},
|
||||||
@@ -138,7 +191,7 @@ static Key key[] = {
|
|||||||
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0},
|
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0},
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0},
|
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0},
|
||||||
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
|
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
|
||||||
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
|
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
|
||||||
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0},
|
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0},
|
||||||
{ XK_KP_End, ControlMask, "\033[J", -1, 0, 0},
|
{ XK_KP_End, ControlMask, "\033[J", -1, 0, 0},
|
||||||
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0},
|
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0},
|
||||||
@@ -153,10 +206,10 @@ static Key key[] = {
|
|||||||
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
|
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
|
||||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
|
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
|
||||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
|
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
|
||||||
{ XK_KP_Delete, ControlMask, "\033[2J", -1, 0, 0},
|
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0},
|
||||||
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
|
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
|
||||||
{ XK_KP_Delete, ShiftMask, "\033[2K", +1, 0, 0},
|
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0},
|
||||||
{ XK_KP_Delete, ShiftMask, "\033[3;2~", -1, 0, 0},
|
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0},
|
||||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
|
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
|
||||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0},
|
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0},
|
||||||
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0},
|
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0},
|
||||||
@@ -177,7 +230,6 @@ static Key key[] = {
|
|||||||
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0},
|
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0},
|
||||||
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0},
|
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0},
|
||||||
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0},
|
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0},
|
||||||
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0},
|
|
||||||
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0},
|
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0},
|
||||||
{ XK_Up, ControlMask, "\033[1;5A", 0, 0, 0},
|
{ XK_Up, ControlMask, "\033[1;5A", 0, 0, 0},
|
||||||
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0},
|
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0},
|
||||||
@@ -191,7 +243,7 @@ static Key key[] = {
|
|||||||
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0},
|
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0},
|
||||||
{ XK_Left, ControlMask, "\033[1;5D", 0, 0, 0},
|
{ XK_Left, ControlMask, "\033[1;5D", 0, 0, 0},
|
||||||
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0},
|
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0},
|
||||||
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0},
|
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0},
|
||||||
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0},
|
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0},
|
||||||
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0},
|
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0},
|
||||||
{ XK_Right, ControlMask, "\033[1;5C", 0, 0, 0},
|
{ XK_Right, ControlMask, "\033[1;5C", 0, 0, 0},
|
||||||
@@ -209,13 +261,15 @@ static Key key[] = {
|
|||||||
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
|
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
|
||||||
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
|
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
|
||||||
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
|
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
|
||||||
{ XK_Delete, ControlMask, "\033[2J", -1, 0, 0},
|
{ XK_Delete, ControlMask, "\033[M", -1, 0, 0},
|
||||||
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
|
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
|
||||||
{ XK_Delete, ShiftMask, "\033[2K", +1, 0, 0},
|
{ XK_Delete, ShiftMask, "\033[2K", -1, 0, 0},
|
||||||
{ XK_Delete, ShiftMask, "\033[3;2~", -1, 0, 0},
|
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0},
|
||||||
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
|
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
|
||||||
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0},
|
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0},
|
||||||
{ XK_Home, ShiftMask, "\033[1;2H", 0, 0, 0},
|
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0},
|
||||||
|
{ XK_Home, ShiftMask, "\033[2J", 0, -1, 0},
|
||||||
|
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0},
|
||||||
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
|
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
|
||||||
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
|
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
|
||||||
{ XK_End, ControlMask, "\033[J", -1, 0, 0},
|
{ XK_End, ControlMask, "\033[J", -1, 0, 0},
|
||||||
@@ -225,7 +279,7 @@ static Key key[] = {
|
|||||||
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
|
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
|
||||||
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0},
|
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0},
|
||||||
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
|
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
|
||||||
{ XK_Prior, XK_NO_MOD, "\033[5~", 0, 0, 0},
|
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
|
||||||
{ XK_Next, ControlMask, "\033[6;5~", 0, 0, 0},
|
{ XK_Next, ControlMask, "\033[6;5~", 0, 0, 0},
|
||||||
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0},
|
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0},
|
||||||
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0},
|
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0},
|
||||||
@@ -249,7 +303,7 @@ static Key key[] = {
|
|||||||
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0},
|
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0},
|
||||||
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0},
|
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0},
|
||||||
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0},
|
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0},
|
||||||
{ XK_F4, /* F28 */ ShiftMask, "\033[1;5S", 0, 0, 0},
|
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0},
|
||||||
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0},
|
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0},
|
||||||
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0},
|
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0},
|
||||||
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0},
|
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0},
|
||||||
@@ -324,7 +378,6 @@ static Key key[] = {
|
|||||||
* ButtonRelease and MotionNotify.
|
* ButtonRelease and MotionNotify.
|
||||||
* If no match is found, regular selection is used.
|
* If no match is found, regular selection is used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static uint selmasks[] = {
|
static uint selmasks[] = {
|
||||||
[SEL_RECTANGULAR] = Mod1Mask,
|
[SEL_RECTANGULAR] = Mod1Mask,
|
||||||
};
|
};
|
||||||
|
16
config.mk
16
config.mk
@@ -1,5 +1,5 @@
|
|||||||
# st version
|
# st version
|
||||||
VERSION = 0.4
|
VERSION = 0.6
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
@@ -12,17 +12,17 @@ X11LIB = /usr/X11R6/lib
|
|||||||
|
|
||||||
# includes and libs
|
# includes and libs
|
||||||
INCS = -I. -I/usr/include -I${X11INC} \
|
INCS = -I. -I/usr/include -I${X11INC} \
|
||||||
$(shell pkg-config --cflags fontconfig) \
|
`pkg-config --cflags fontconfig` \
|
||||||
$(shell pkg-config --cflags freetype2)
|
`pkg-config --cflags freetype2`
|
||||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
|
LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft \
|
||||||
$(shell pkg-config --libs fontconfig) \
|
`pkg-config --libs fontconfig` \
|
||||||
$(shell pkg-config --libs freetype2)
|
`pkg-config --libs freetype2`
|
||||||
|
|
||||||
# flags
|
# flags
|
||||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE -D_XOPEN_SOURCE=600
|
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
|
||||||
CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS}
|
CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS}
|
||||||
LDFLAGS += -g ${LIBS}
|
LDFLAGS += -g ${LIBS}
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
CC ?= cc
|
# CC = cc
|
||||||
|
|
||||||
|
88
st.1
88
st.1
@@ -3,26 +3,56 @@
|
|||||||
st \- simple terminal
|
st \- simple terminal
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B st
|
.B st
|
||||||
|
.RB [ \-a ]
|
||||||
.RB [ \-c
|
.RB [ \-c
|
||||||
.IR class ]
|
.IR class ]
|
||||||
.RB [ \-f
|
.RB [ \-f
|
||||||
.IR font ]
|
.IR font ]
|
||||||
.RB [ \-g
|
.RB [ \-g
|
||||||
.IR geometry ]
|
.IR geometry ]
|
||||||
|
.RB [ \-i ]
|
||||||
.RB [ \-o
|
.RB [ \-o
|
||||||
.IR file ]
|
.IR file ]
|
||||||
.RB [ \-t
|
.RB [ \-t
|
||||||
.IR title ]
|
.IR title ]
|
||||||
|
.RB [ \-l
|
||||||
|
.IR line ]
|
||||||
.RB [ \-w
|
.RB [ \-w
|
||||||
.IR windowid ]
|
.IR windowid ]
|
||||||
.RB [ \-v ]
|
.RB [ \-v ]
|
||||||
.RB [ \-e
|
.RB [ \-e
|
||||||
.IR command ...]
|
.IR command ...]
|
||||||
|
.RI [ commands ...]
|
||||||
|
.PP
|
||||||
|
.B st
|
||||||
|
.RB [ \-a ]
|
||||||
|
.RB [ \-c
|
||||||
|
.IR class ]
|
||||||
|
.RB [ \-f
|
||||||
|
.IR font ]
|
||||||
|
.RB [ \-g
|
||||||
|
.IR geometry ]
|
||||||
|
.RB [ \-i ]
|
||||||
|
.RB [ \-o
|
||||||
|
.IR file ]
|
||||||
|
.RB [ \-t
|
||||||
|
.IR title ]
|
||||||
|
.RB [ \-l
|
||||||
|
.IR line ]
|
||||||
|
.RB [ \-w
|
||||||
|
.IR windowid ]
|
||||||
|
.RB [ \-v ]
|
||||||
|
.RB [ \-l
|
||||||
|
.IR line ]
|
||||||
|
.RI [ stty_args ...]
|
||||||
.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 \-a
|
||||||
|
disable alternate screens in terminal
|
||||||
|
.TP
|
||||||
.BI \-c " class"
|
.BI \-c " class"
|
||||||
defines the window class (default $TERM).
|
defines the window class (default $TERM).
|
||||||
.TP
|
.TP
|
||||||
@@ -32,11 +62,17 @@ defines the
|
|||||||
to use when st is run.
|
to use when st is run.
|
||||||
.TP
|
.TP
|
||||||
.BI \-g " geometry"
|
.BI \-g " geometry"
|
||||||
defines the X11 geometry string, which will fixate the height and width of st.
|
defines the X11 geometry string.
|
||||||
|
The form is [=][<cols>{xX}<rows>][{+-}<xoffset>{+-}<yoffset>]. See
|
||||||
|
.BR XParseGeometry (3)
|
||||||
|
for further details.
|
||||||
.TP
|
.TP
|
||||||
.BI \-o " file"
|
.B \-i
|
||||||
|
will fixate the position given with the -g option.
|
||||||
|
.TP
|
||||||
|
.BI \-o " iofile"
|
||||||
writes all the I/O to
|
writes all the I/O to
|
||||||
.I file.
|
.I iofile.
|
||||||
This feature is useful when recording st sessions. A value of "-" means
|
This feature is useful when recording st sessions. A value of "-" means
|
||||||
standard output.
|
standard output.
|
||||||
.TP
|
.TP
|
||||||
@@ -47,6 +83,11 @@ defines the window title (default 'st').
|
|||||||
embeds st within the window identified by
|
embeds st within the window identified by
|
||||||
.I windowid
|
.I windowid
|
||||||
.TP
|
.TP
|
||||||
|
.BI \-l " line"
|
||||||
|
use a tty line instead of a pseudo terminal.
|
||||||
|
When this flag is used
|
||||||
|
remaining arguments are used as flags for stty.
|
||||||
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
prints version information to stderr, then exits.
|
prints version information to stderr, then exits.
|
||||||
.TP
|
.TP
|
||||||
@@ -56,6 +97,43 @@ st executes
|
|||||||
instead of the shell. If this is used it
|
instead of the shell. If this is used it
|
||||||
.B must be the last option
|
.B must be the last option
|
||||||
on the command line, as in xterm / rxvt.
|
on the command line, as in xterm / rxvt.
|
||||||
|
This option is only intended for compability,
|
||||||
|
and all the remaining arguments are used as a command
|
||||||
|
even without it.
|
||||||
|
.SH SHORTCUTS
|
||||||
|
.TP
|
||||||
|
.B Ctrl-Print Screen
|
||||||
|
Toggle if st should print to the
|
||||||
|
.I iofile.
|
||||||
|
.TP
|
||||||
|
.B Shift-Print Screen
|
||||||
|
Print the full screen to the
|
||||||
|
.I iofile.
|
||||||
|
.TP
|
||||||
|
.B Print Screen
|
||||||
|
Print the selection to the
|
||||||
|
.I iofile.
|
||||||
|
.TP
|
||||||
|
.B Alt-Shift-Page Up
|
||||||
|
Increase font size.
|
||||||
|
.TP
|
||||||
|
.B Alt-Shift-Page Down
|
||||||
|
Decrease font size.
|
||||||
|
.TP
|
||||||
|
.B Alt-Shift-Home
|
||||||
|
Reset to default font size.
|
||||||
|
.TP
|
||||||
|
.B Shift-Insert
|
||||||
|
Paste from primary selection (middle mouse button).
|
||||||
|
.TP
|
||||||
|
.B Alt-Shift-Insert
|
||||||
|
Paste from clipboard selection.
|
||||||
|
.TP
|
||||||
|
.B Alt-Shift-c
|
||||||
|
Copy the selected text to the clipboard selection.
|
||||||
|
.TP
|
||||||
|
.B Alt-Shift-v
|
||||||
|
Paste from the clipboard selection.
|
||||||
.SH CUSTOMIZATION
|
.SH CUSTOMIZATION
|
||||||
.B st
|
.B st
|
||||||
can be customized by creating a custom config.h and (re)compiling the source
|
can be customized by creating a custom config.h and (re)compiling the source
|
||||||
@@ -65,7 +143,9 @@ See the LICENSE file for the authors.
|
|||||||
.SH LICENSE
|
.SH LICENSE
|
||||||
See the LICENSE file for the terms of redistribution.
|
See the LICENSE file for the terms of redistribution.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR tabbed (1)
|
.BR tabbed (1),
|
||||||
|
.BR utmp (1),
|
||||||
|
.BR stty (1)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
See the TODO file in the distribution.
|
See the TODO file in the distribution.
|
||||||
|
|
||||||
|
33
st.info
33
st.info
@@ -1,11 +1,9 @@
|
|||||||
# unsupported xterm caps are (getting) commented.
|
|
||||||
# as soon as they work, uncomment them.
|
|
||||||
st| simpleterm,
|
st| simpleterm,
|
||||||
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
|
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
|
||||||
am,
|
am,
|
||||||
bce,
|
bce,
|
||||||
bel=^G,
|
bel=^G,
|
||||||
# blink=\E[5m,
|
blink=\E[5m,
|
||||||
bold=\E[1m,
|
bold=\E[1m,
|
||||||
cbt=\E[Z,
|
cbt=\E[Z,
|
||||||
cvvis=\E[?25h,
|
cvvis=\E[?25h,
|
||||||
@@ -34,7 +32,7 @@ st| simpleterm,
|
|||||||
el=\E[K,
|
el=\E[K,
|
||||||
el1=\E[1K,
|
el1=\E[1K,
|
||||||
enacs=\E)0,
|
enacs=\E)0,
|
||||||
flash=\E[?5h\E[?5l,
|
flash=\E[?5h$<80/>\E[?5l,
|
||||||
fsl=^G,
|
fsl=^G,
|
||||||
home=\E[H,
|
home=\E[H,
|
||||||
hpa=\E[%i%p1%dG,
|
hpa=\E[%i%p1%dG,
|
||||||
@@ -47,7 +45,7 @@ st| simpleterm,
|
|||||||
ind=^J,
|
ind=^J,
|
||||||
indn=\E[%p1%dS,
|
indn=\E[%p1%dS,
|
||||||
invis=\E[8m,
|
invis=\E[8m,
|
||||||
is2=\E[4l\E>,
|
is2=\E[4l\E>\E[?1034l,
|
||||||
it#8,
|
it#8,
|
||||||
kel=\E[1;2F,
|
kel=\E[1;2F,
|
||||||
ked=\E[1;5F,
|
ked=\E[1;5F,
|
||||||
@@ -152,8 +150,12 @@ st| simpleterm,
|
|||||||
mir,
|
mir,
|
||||||
msgr,
|
msgr,
|
||||||
ncv#3,
|
ncv#3,
|
||||||
|
npc,
|
||||||
op=\E[39;49m,
|
op=\E[39;49m,
|
||||||
pairs#64,
|
pairs#64,
|
||||||
|
mc0=\E[i,
|
||||||
|
mc4=\E[4i,
|
||||||
|
mc5=\E[5i,
|
||||||
rc=\E8,
|
rc=\E8,
|
||||||
rev=\E[7m,
|
rev=\E[7m,
|
||||||
ri=\EM,
|
ri=\EM,
|
||||||
@@ -163,9 +165,9 @@ st| simpleterm,
|
|||||||
rmir=\E[4l,
|
rmir=\E[4l,
|
||||||
rmkx=\E[?1l\E>,
|
rmkx=\E[?1l\E>,
|
||||||
rmso=\E[27m,
|
rmso=\E[27m,
|
||||||
rmul=\E[m,
|
rmul=\E[24m,
|
||||||
rs1=\Ec,
|
rs1=\Ec,
|
||||||
rs2=\E[4l\E>,
|
rs2=\E[4l\E>\E[?1034l,
|
||||||
sc=\E7,
|
sc=\E7,
|
||||||
setab=\E[4%p1%dm,
|
setab=\E[4%p1%dm,
|
||||||
setaf=\E[3%p1%dm,
|
setaf=\E[3%p1%dm,
|
||||||
@@ -182,7 +184,6 @@ st| simpleterm,
|
|||||||
smul=\E[4m,
|
smul=\E[4m,
|
||||||
tbc=\E[3g,
|
tbc=\E[3g,
|
||||||
tsl=\E]0;,
|
tsl=\E]0;,
|
||||||
ul,
|
|
||||||
xenl,
|
xenl,
|
||||||
vpa=\E[%i%p1%dd,
|
vpa=\E[%i%p1%dd,
|
||||||
|
|
||||||
@@ -194,3 +195,19 @@ st-256color| simpleterm with 256 colors,
|
|||||||
# Nicked from xterm-256color
|
# Nicked from xterm-256color
|
||||||
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
|
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
|
||||||
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
|
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
|
||||||
|
|
||||||
|
st-meta| simpleterm with meta key,
|
||||||
|
use=st,
|
||||||
|
km,
|
||||||
|
rmm=\E[?1034l,
|
||||||
|
smm=\E[?1034h,
|
||||||
|
rs2=\E[4l\E>\E[?1034h,
|
||||||
|
is2=\E[4l\E>\E[?1034h,
|
||||||
|
|
||||||
|
st-meta-256color| simpleterm with meta key and 256 colors,
|
||||||
|
use=st-256color,
|
||||||
|
km,
|
||||||
|
rmm=\E[?1034l,
|
||||||
|
smm=\E[?1034h,
|
||||||
|
rs2=\E[4l\E>\E[?1034h,
|
||||||
|
is2=\E[4l\E>\E[?1034h,
|
||||||
|
Reference in New Issue
Block a user