Compare commits
18 Commits
b980da555f
...
b8f883325d
Author | SHA1 | Date | |
---|---|---|---|
|
b8f883325d | ||
|
a0274bc20e | ||
|
5dbcca4926 | ||
|
d63b9eb902 | ||
|
497a756382 | ||
|
8c68ec5241 | ||
|
5ce9716281 | ||
|
f20e169a20 | ||
|
95f22c5305 | ||
|
7473a8d1a5 | ||
|
a3f7420310 | ||
|
9846a56bd7 | ||
|
559fdc2786 | ||
|
8abe4bcb41 | ||
|
2fc7e532b2 | ||
|
a6bbc0c96b | ||
|
eb3b894f40 | ||
|
3a6d6d7401 |
10
Makefile
10
Makefile
@ -7,13 +7,7 @@ include config.mk
|
|||||||
SRC = st.c x.c hb.c
|
SRC = st.c x.c hb.c
|
||||||
OBJ = $(SRC:.c=.o)
|
OBJ = $(SRC:.c=.o)
|
||||||
|
|
||||||
all: options st
|
all: st
|
||||||
|
|
||||||
options:
|
|
||||||
@echo st build options:
|
|
||||||
@echo "CFLAGS = $(STCFLAGS)"
|
|
||||||
@echo "LDFLAGS = $(STLDFLAGS)"
|
|
||||||
@echo "CC = $(CC)"
|
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
cp config.def.h config.h
|
cp config.def.h config.h
|
||||||
@ -55,4 +49,4 @@ uninstall:
|
|||||||
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
||||||
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
||||||
|
|
||||||
.PHONY: all options clean dist install uninstall
|
.PHONY: all clean dist install uninstall
|
||||||
|
@ -59,7 +59,7 @@ int allowwindowops = 0;
|
|||||||
* near minlatency, but it waits longer for slow updates to avoid partial draw.
|
* near minlatency, but it waits longer for slow updates to avoid partial draw.
|
||||||
* low minlatency will tear/flicker more, as it can "detect" idle too early.
|
* low minlatency will tear/flicker more, as it can "detect" idle too early.
|
||||||
*/
|
*/
|
||||||
static double minlatency = 8;
|
static double minlatency = 2;
|
||||||
static double maxlatency = 33;
|
static double maxlatency = 33;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# st version
|
# st version
|
||||||
VERSION = 0.9
|
VERSION = 0.9.2
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
20
st.c
20
st.c
@ -1198,7 +1198,7 @@ tscrollup(int orig, int n, int copyhist)
|
|||||||
void
|
void
|
||||||
selscroll(int orig, int n)
|
selscroll(int orig, int n)
|
||||||
{
|
{
|
||||||
if (sel.ob.x == -1)
|
if (sel.ob.x == -1 || sel.alt != IS_SET(MODE_ALTSCREEN))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) {
|
if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) {
|
||||||
@ -1255,6 +1255,7 @@ csiparse(void)
|
|||||||
{
|
{
|
||||||
char *p = csiescseq.buf, *np;
|
char *p = csiescseq.buf, *np;
|
||||||
long int v;
|
long int v;
|
||||||
|
int sep = ';'; /* colon or semi-colon, but not both */
|
||||||
|
|
||||||
csiescseq.narg = 0;
|
csiescseq.narg = 0;
|
||||||
if (*p == '?') {
|
if (*p == '?') {
|
||||||
@ -1273,7 +1274,9 @@ csiparse(void)
|
|||||||
csiescseq.arg[csiescseq.narg++] = v;
|
csiescseq.arg[csiescseq.narg++] = v;
|
||||||
p = np;
|
p = np;
|
||||||
readcolonargs(&p, csiescseq.narg-1, csiescseq.carg);
|
readcolonargs(&p, csiescseq.narg-1, csiescseq.carg);
|
||||||
if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ)
|
if (sep == ';' && *p == ':')
|
||||||
|
sep = ':'; /* allow override to colon once */
|
||||||
|
if (*p != sep || csiescseq.narg == ESC_ARG_SIZ)
|
||||||
break;
|
break;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
@ -1790,7 +1793,7 @@ csihandle(void)
|
|||||||
ttywrite(vtiden, strlen(vtiden), 0);
|
ttywrite(vtiden, strlen(vtiden), 0);
|
||||||
break;
|
break;
|
||||||
case 'b': /* REP -- if last char is printable print it <n> more times */
|
case 'b': /* REP -- if last char is printable print it <n> more times */
|
||||||
DEFAULT(csiescseq.arg[0], 1);
|
LIMIT(csiescseq.arg[0], 1, 65535);
|
||||||
if (term.lastc)
|
if (term.lastc)
|
||||||
while (csiescseq.arg[0]-- > 0)
|
while (csiescseq.arg[0]-- > 0)
|
||||||
tputc(term.lastc);
|
tputc(term.lastc);
|
||||||
@ -1875,6 +1878,7 @@ csihandle(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'S': /* SU -- Scroll <n> line up */
|
case 'S': /* SU -- Scroll <n> line up */
|
||||||
|
if (csiescseq.priv) break;
|
||||||
DEFAULT(csiescseq.arg[0], 1);
|
DEFAULT(csiescseq.arg[0], 1);
|
||||||
tscrollup(term.top, csiescseq.arg[0], 0);
|
tscrollup(term.top, csiescseq.arg[0], 0);
|
||||||
break;
|
break;
|
||||||
@ -2483,6 +2487,7 @@ eschandle(uchar ascii)
|
|||||||
treset();
|
treset();
|
||||||
resettitle();
|
resettitle();
|
||||||
xloadcols();
|
xloadcols();
|
||||||
|
xsetmode(0, MODE_HIDE);
|
||||||
break;
|
break;
|
||||||
case '=': /* DECPAM -- Application keypad */
|
case '=': /* DECPAM -- Application keypad */
|
||||||
xsetmode(1, MODE_APPKEYPAD);
|
xsetmode(1, MODE_APPKEYPAD);
|
||||||
@ -2624,11 +2629,16 @@ check_control_code:
|
|||||||
gp = &term.line[term.c.y][term.c.x];
|
gp = &term.line[term.c.y][term.c.x];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_SET(MODE_INSERT) && term.c.x+width < term.col)
|
if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) {
|
||||||
memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph));
|
memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph));
|
||||||
|
gp->mode &= ~ATTR_WIDE;
|
||||||
|
}
|
||||||
|
|
||||||
if (term.c.x+width > term.col) {
|
if (term.c.x+width > term.col) {
|
||||||
tnewline(1);
|
if (IS_SET(MODE_WRAP))
|
||||||
|
tnewline(1);
|
||||||
|
else
|
||||||
|
tmoveto(term.col - width, term.c.y);
|
||||||
gp = &term.line[term.c.y][term.c.x];
|
gp = &term.line[term.c.y][term.c.x];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
st.info
4
st.info
@ -185,6 +185,10 @@ st-mono| simpleterm monocolor,
|
|||||||
# XTerm extensions
|
# XTerm extensions
|
||||||
rmxx=\E[29m,
|
rmxx=\E[29m,
|
||||||
smxx=\E[9m,
|
smxx=\E[9m,
|
||||||
|
BE=\E[?2004h,
|
||||||
|
BD=\E[?2004l,
|
||||||
|
PS=\E[200~,
|
||||||
|
PE=\E[201~,
|
||||||
# disabled rep for now: causes some issues with older ncurses versions.
|
# disabled rep for now: causes some issues with older ncurses versions.
|
||||||
# rep=%p1%c\E[%p2%{1}%-%db,
|
# rep=%p1%c\E[%p2%{1}%-%db,
|
||||||
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
|
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
|
||||||
|
19
x.c
19
x.c
@ -858,7 +858,7 @@ xloadcols(void)
|
|||||||
int
|
int
|
||||||
xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
|
xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
|
||||||
{
|
{
|
||||||
if (!BETWEEN(x, 0, dc.collen))
|
if (!BETWEEN(x, 0, dc.collen - 1))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
*r = dc.col[x].color.red >> 8;
|
*r = dc.col[x].color.red >> 8;
|
||||||
@ -873,7 +873,7 @@ xsetcolorname(int x, const char *name)
|
|||||||
{
|
{
|
||||||
Color ncolor;
|
Color ncolor;
|
||||||
|
|
||||||
if (!BETWEEN(x, 0, dc.collen))
|
if (!BETWEEN(x, 0, dc.collen - 1))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!xloadcolor(x, name, &ncolor))
|
if (!xloadcolor(x, name, &ncolor))
|
||||||
@ -1268,7 +1268,8 @@ void
|
|||||||
xinit(int cols, int rows)
|
xinit(int cols, int rows)
|
||||||
{
|
{
|
||||||
XGCValues gcvalues;
|
XGCValues gcvalues;
|
||||||
Window parent;
|
Cursor cursor;
|
||||||
|
Window parent, root;
|
||||||
pid_t thispid = getpid();
|
pid_t thispid = getpid();
|
||||||
XColor xmousefg, xmousebg;
|
XColor xmousefg, xmousebg;
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
@ -1321,15 +1322,21 @@ xinit(int cols, int rows)
|
|||||||
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
|
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
|
||||||
xw.attrs.colormap = xw.cmap;
|
xw.attrs.colormap = xw.cmap;
|
||||||
|
|
||||||
|
root = XRootWindow(xw.dpy, xw.scr);
|
||||||
|
if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
|
||||||
|
parent = XRootWindow(xw.dpy, xw.scr);
|
||||||
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
|
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
|
||||||
win.w, win.h, 0, xw.depth, InputOutput,
|
win.w, win.h, 0, xw.depth, InputOutput,
|
||||||
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
|
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
|
||||||
| CWEventMask | CWColormap, &xw.attrs);
|
| CWEventMask | CWColormap, &xw.attrs);
|
||||||
|
if (parent != root)
|
||||||
|
XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t);
|
||||||
|
|
||||||
memset(&gcvalues, 0, sizeof(gcvalues));
|
memset(&gcvalues, 0, sizeof(gcvalues));
|
||||||
gcvalues.graphics_exposures = False;
|
gcvalues.graphics_exposures = False;
|
||||||
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
|
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
|
||||||
dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues);
|
dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues);
|
||||||
|
/* dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, &gcvalues); */
|
||||||
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
|
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
|
||||||
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
|
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
|
||||||
|
|
||||||
@ -2179,6 +2186,9 @@ xseticontitle(char *p)
|
|||||||
XTextProperty prop;
|
XTextProperty prop;
|
||||||
DEFAULT(p, opt_title);
|
DEFAULT(p, opt_title);
|
||||||
|
|
||||||
|
if (p[0] == '\0')
|
||||||
|
p = opt_title;
|
||||||
|
|
||||||
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
|
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
|
||||||
&prop) != Success)
|
&prop) != Success)
|
||||||
return;
|
return;
|
||||||
@ -2193,6 +2203,9 @@ xsettitle(char *p)
|
|||||||
XTextProperty prop;
|
XTextProperty prop;
|
||||||
DEFAULT(p, opt_title);
|
DEFAULT(p, opt_title);
|
||||||
|
|
||||||
|
if (p[0] == '\0')
|
||||||
|
p = opt_title;
|
||||||
|
|
||||||
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
|
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
|
||||||
&prop) != Success)
|
&prop) != Success)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user