36 Commits
Author SHA1 Message Date
Aurélien Aptel ae0966484c cosmetic, whitespace, etc. 2012-01-21 23:43:03 +01:00
Aurélien Aptel 156ce77645 fix PRINT/DRAW _TIMEOUT and fix redrawing bug. 2012-01-21 23:26:53 +01:00
Aurélien Aptel 96c22e1604 copy dirty lines to screen, add select() timeout & min time between draw() calls.
* add a timeout value (SELECT_TIMEOUT) of 20ms in the select() call
* wait at least 20ms (DRAW_TIMEOUT) between draw() calls
* only copy dirty lines from the buffer to the screen

what draw() does:
* clears dirty lines in the buffer
* draws the longest same-attributes string of each
  dirty line to the buffer with multiple xdraws() call
* copies the current dirty line from buffer to the screen with a single
  xcopy() call

this changeset makes st run ~10x faster.
2012-01-21 23:14:41 +01:00
Aurélien Aptel 281174445b fix segfault in selection. (thx Martti Kühne) 2012-01-10 22:21:03 +01:00
Aurélien Aptel 197c466864 merge. 2011-11-01 16:37:16 +01:00
Aurélien Aptel 5ca0d3d2fa fix selection. (thx Tarmo Heiskanen) 2011-11-01 16:33:43 +01:00
Aurélien Aptel b1b9dc7eb5 drawregion() only copies region on screen. 2011-10-20 23:26:58 +02:00
Aurélien Aptel 44c83397af add dirty flag for lines 2011-10-20 23:20:59 +02:00
Aurélien Aptel 7c350025b2 no palette limit (thx Nick) 2011-10-06 21:32:34 +02:00
Aurélien Aptel 4a421ffbbc simplify version format. 2011-09-22 10:04:58 +02:00
Aurélien Aptel 62a92ca1aa selection is removed or scrolled properly. (thx Rafa Garcia Gallego) 2011-09-16 18:48:16 +02:00
Aurélien Aptel 98042a1a2d working on old repo, merging recent changesets. 2011-09-16 18:24:13 +02:00
Aurélien Aptel 5c6df8b3c3 move xembedatom in XWindow struct, add link to xembed specs. 2011-09-16 18:21:48 +02:00
Aurélien Aptel 43a4c5ebb2 tweak focus to support XEMBED client message and remove focus on EnterNotify. (thx Adrian) 2011-09-16 18:03:44 +02:00
Aurélien Aptel bf2e23f535 remove dup of default window size. 2011-09-16 17:57:56 +02:00
Aurélien Aptel 5d1c52bf5c change "op" cap in terminfo entry to xterm/rxvt value. 2011-08-14 17:15:19 +02:00
Aurélien Aptel 54adc7ee50 fix custom key handling. 2011-08-14 17:13:59 +02:00
Aurélien Aptel e2809f3976 fix focus state when embed in another window. 2011-06-09 18:25:56 +02:00
Aurélien Aptel ce547d3060 fix segfault with mouse selection. (thx anonymous) 2011-06-09 14:27:07 +02:00
Aurélien Aptel 4259a3ba3a add -w option to embed st. (thx nodus cursorius) 2011-06-08 21:35:58 +02:00
Aurélien Aptel fb32d01a18 applied parts of "anonymous" cleanup patch. 2011-06-08 20:26:00 +02:00
Aurélien Aptel 986670d080 add altscreen escseq alias & caps to terminfo entry. (thx Bert Münnich) 2011-06-08 20:22:38 +02:00
Aurélien Aptel 6eaec4732f disable mouse highlight when mouse report enabled. (thx Bert Münnich) 2011-06-08 19:32:10 +02:00
Aurélien Aptel 2edb412b6b reverse video mode. (thx Bert Münnich) 2011-06-08 12:40:35 +02:00
Aurélien Aptel bf6a11a482 add status bar (window title) to terminfo. (thx Rafa Gallego) 2011-06-01 19:57:48 +02:00
Aurélien Aptel a05423cb6a set title before mapping window (thx Kamil Cholewiński). 2011-05-22 16:57:27 +02:00
Aurélien Aptel cdd993c39e applied parts of Connor Lane Smith's cleanup patch. 2011-05-14 17:47:37 +02:00
Aurélien Aptel a7f4af0139 macro cleanup. 2011-05-10 22:55:35 +02:00
Aurélien Aptel 225fc7cbcf add mouse report escape to terminfo entry. 2011-05-10 22:54:30 +02:00
Aurélien Aptel 9760a7a831 support for x11 xterm mouse reporting 2011-05-10 22:22:44 +02:00
Aurélien Aptel 9a3cc64f9d whitespace. 2011-04-26 20:29:28 +02:00
Aurélien Aptel 3d0eeac7a8 cleanup. 2011-04-26 20:22:15 +02:00
Aurélien Aptel 31ba817cc3 update TODO 2011-04-22 00:42:58 +02:00
Aurélien Aptel e4dd367a4f selection clicks, shift+arrow keys, fast(er) redraw, key mask in config.h (thx Magnus Leuthner) 2011-04-22 00:18:53 +02:00
Aurélien Aptel 043fb982c5 update README. 2011-04-03 21:40:33 +02:00
Aurélien Aptel 7f3ea64d61 quick bug-fixing 0.1.1 release. 2011-04-03 21:05:41 +02:00
7 changed files with 459 additions and 190 deletions

No files matched your search

+1
View File
@@ -1 +1,2 @@
cbc18c988236c63a58ed24031805e8d36a3ad01a 0.1
f245ac2efd8ac2f1ac6bffae876c2663e794f79d 0.1.1
+8 -1
View File
@@ -21,7 +21,14 @@ necessary as root):
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
-------
+9 -3
View File
@@ -9,7 +9,13 @@ code & interface
----------------
* clean selection code
* use the real x11 clipboard
* clean terminfo entry
* utf8
* clean and complete terminfo entry
* fix shift up/down (shift selection in emacs)
* fast drawing
* ...
misc
----
$ grep -nE 'XXX|TODO' st.c
+34 -23
View File
@@ -5,7 +5,7 @@
#define BORDER 2
#define SHELL "/bin/sh"
/* Terminal colors */
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
"black",
"red3",
@@ -25,33 +25,40 @@ static const char *colorname[] = {
"white"
};
/* Default colors (colorname index) */
/* foreground, background, cursor */
/* Default colors (colorname index)
foreground, background, cursor */
#define DefaultFG 7
#define DefaultBG 0
#define DefaultCS 1
/* 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[] = {
{ XK_BackSpace, "\177" },
{ XK_Insert, "\033[2~" },
{ XK_Delete, "\033[3~" },
{ XK_Home, "\033[1~" },
{ XK_End, "\033[4~" },
{ XK_Prior, "\033[5~" },
{ XK_Next, "\033[6~" },
{ XK_F1, "\033OP" },
{ XK_F2, "\033OQ" },
{ XK_F3, "\033OR" },
{ XK_F4, "\033OS" },
{ XK_F5, "\033[15~" },
{ XK_F6, "\033[17~" },
{ XK_F7, "\033[18~" },
{ XK_F8, "\033[19~" },
{ XK_F9, "\033[20~" },
{ XK_F10, "\033[21~" },
{ XK_F11, "\033[23~" },
{ XK_F12, "\033[24~" },
{ XK_BackSpace, XK_NO_MOD, "\177" },
{ 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~" },
{ XK_Prior, XK_NO_MOD, "\033[5~" },
{ XK_Next, XK_NO_MOD, "\033[6~" },
{ XK_F1, XK_NO_MOD, "\033OP" },
{ XK_F2, XK_NO_MOD, "\033OQ" },
{ XK_F3, XK_NO_MOD, "\033OR" },
{ XK_F4, XK_NO_MOD, "\033OS" },
{ XK_F5, XK_NO_MOD, "\033[15~" },
{ XK_F6, XK_NO_MOD, "\033[17~" },
{ XK_F7, XK_NO_MOD, "\033[18~" },
{ XK_F8, XK_NO_MOD, "\033[19~" },
{ XK_F9, XK_NO_MOD, "\033[20~" },
{ XK_F10, XK_NO_MOD, "\033[21~" },
{ XK_F11, XK_NO_MOD, "\033[23~" },
{ XK_F12, XK_NO_MOD, "\033[24~" },
};
/* Line drawing characters (sometime specific to each font...) */
@@ -61,3 +68,7 @@ static char gfx[] = {
['i'] = '#',
[255] = 0,
};
/* double-click timeout (in milliseconds) between clicks for selection */
#define DOUBLECLICK_TIMEOUT 300
#define TRIPLECLICK_TIMEOUT (2*DOUBLECLICK_TIMEOUT)
+19 -13
View File
@@ -1,4 +1,4 @@
.TH ST 1 st-VERSION
.TH ST 1 st\-VERSION
.SH NAME
st \- simple terminal
.SH SYNOPSIS
@@ -7,26 +7,32 @@ st \- simple terminal
.IR class ]
.RB [ \-t
.IR title ]
.RB [ \-w
.IR windowid ]
.RB [ \-v ]
.RB [ \-e
.IR cmd ]
.IR command ...]
.SH DESCRIPTION
.B st
is a simple terminal emulator.
.SH OPTIONS
.TP
.B \-t title
Overrides the default title (st)
.BI \-t " title"
defines the window title (default 'st').
.TP
.B \-c class
Overrides the default class ($TERM)
.BI \-c " class"
defines the window class (default $TERM).
.TP
.BI \-w " windowid"
embeds st within the window identified by
.I windowid
.TP
.B \-v
Prints version information to standard output, then exits.
prints version information to stderr, then exits.
.TP
.B \-e cmd [arguments]
Execute cmd instead of the shell. Type your command as you would on your
shell. If this option is used, it
.BI "must be the last"
on the command-line. This is the same behaviour as xterm/rxvt.
.BI \-e " program " [ " arguments " "... ]"
st executes
.I program
instead of the shell. If this is used it
.B must be the last option
on the command line, as in xterm / rxvt.
+376 -149
View File
File diff suppressed because it is too large. Load diff
+12 -1
View File
@@ -33,8 +33,11 @@ st| simpleterm,
ed=\E[J,
el=\E[K,
el1=\E[1K,
flash=\E[?5h\E[?5l,
fsl=^G,
home=\E[H,
hpa=\E[%i%p1%dG,
hs,
ht=^I,
hts=\EH,
ich=\E[%p1%d@,
@@ -49,6 +52,10 @@ st| simpleterm,
kcud1=\E[B,
kcuf1=\E[C,
kcuu1=\E[A,
kLFT=\E[d,
kRIT=\E[c,
kind=\E[a,
kri=\E[b,
kdch1=\E[3~,
kich1=\E[2~,
kend=\E[4~,
@@ -66,17 +73,19 @@ st| simpleterm,
kf9=\E[20~,
khome=\E[1~,
knp=\E[6~,
kmous=\E[M,
kpp=\E[5~,
lines#24,
mir,
msgr,
ncv#3,
op=\E[37;40m,
op=\E[39;49m,
pairs#64,
rc=\E8,
rev=\E[7m,
ri=\EM,
rmacs=\E(B,
rmcup=\E[?1049l,
rmso=\E[m,
rmul=\E[m,
sc=\E7,
@@ -85,9 +94,11 @@ st| simpleterm,
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,
smacs=\E(0,
smcup=\E[?1049h,
smso=\E[7m,
smul=\E[4m,
tbc=\E[2g,
tsl=\E]0;,
ul,
xenl,