Compare commits
18 Commits
93d1567205
...
0d46fd1fb8
| Author | SHA1 | Date |
|---|---|---|
|
|
0d46fd1fb8 | |
|
|
a937a99606 | |
|
|
683675c895 | |
|
|
a65c371597 | |
|
|
220a11be81 | |
|
|
63effe1949 | |
|
|
3f35198a6b | |
|
|
7d55b080c6 | |
|
|
db4024676a | |
|
|
2c0192d5ed | |
|
|
efaf088ee3 | |
|
|
60f2672b8e | |
|
|
bf74b02c6f | |
|
|
5785c2bb7b | |
|
|
191541012c | |
|
|
f5f579ba16 | |
|
|
a24deef995 | |
|
|
611b6dde7e |
10
Makefile
10
Makefile
|
|
@ -7,7 +7,13 @@ include config.mk
|
|||
SRC = st.c x.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
all: st
|
||||
all: options st
|
||||
|
||||
options:
|
||||
@echo st build options:
|
||||
@echo "CFLAGS = $(STCFLAGS)"
|
||||
@echo "LDFLAGS = $(STLDFLAGS)"
|
||||
@echo "CC = $(CC)"
|
||||
|
||||
config.h:
|
||||
cp config.def.h config.h
|
||||
|
|
@ -48,4 +54,4 @@ uninstall:
|
|||
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
||||
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
||||
|
||||
.PHONY: all clean dist install uninstall
|
||||
.PHONY: all options clean dist install uninstall
|
||||
|
|
|
|||
22
config.def.h
22
config.def.h
|
|
@ -53,7 +53,7 @@ int allowwindowops = 0;
|
|||
* 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.
|
||||
*/
|
||||
static double minlatency = 2;
|
||||
static double minlatency = 8;
|
||||
static double maxlatency = 33;
|
||||
|
||||
/*
|
||||
|
|
@ -177,6 +177,16 @@ static unsigned int defaultattr = 11;
|
|||
*/
|
||||
static uint forcemousemod = ShiftMask;
|
||||
|
||||
/*
|
||||
* The number of lines to scroll by.
|
||||
*/
|
||||
const unsigned int scrollrate = 1;
|
||||
|
||||
/*
|
||||
* The rate to zoom in (adjust the font size).
|
||||
*/
|
||||
const unsigned int zoomrate = 1;
|
||||
|
||||
/*
|
||||
* Xresources preferences to load at startup
|
||||
*/
|
||||
|
|
@ -213,16 +223,6 @@ ResourcePref resources[] = {
|
|||
{ "chscale", FLOAT, &chscale },
|
||||
};
|
||||
|
||||
/*
|
||||
* The number of lines to scroll by.
|
||||
*/
|
||||
const unsigned int scrollrate = 1;
|
||||
|
||||
/*
|
||||
* The rate to zoom in (adjust the font size).
|
||||
*/
|
||||
const unsigned int zoomrate = 1;
|
||||
|
||||
/*
|
||||
* Internal mouse shortcuts.
|
||||
* Beware that overloading Button1 will disable the selection.
|
||||
|
|
|
|||
8
config.h
8
config.h
|
|
@ -185,7 +185,7 @@ const unsigned int scrollrate = 5;
|
|||
/*
|
||||
* The rate to zoom in (adjust the font size).
|
||||
*/
|
||||
const int zoomrate = 5;
|
||||
const int zoomrate = 1;
|
||||
|
||||
/*
|
||||
* Xresources preferences to load at startup
|
||||
|
|
@ -220,9 +220,9 @@ ResourcePref resources[] = {
|
|||
*/
|
||||
static MouseShortcut mshortcuts[] = {
|
||||
/* mask button function argument release */
|
||||
{ XK_NO_MOD, Button4, kscrollup, {.i = scrollrate}, 0, /* !alt */ -1 },
|
||||
{ XK_NO_MOD, Button4, kscrollup, {.i = scrollrate}, 0, /* !alt */ -1 },
|
||||
{ XK_NO_MOD, Button5, kscrolldown, {.i = scrollrate}, 0, /* !alt */ -1 },
|
||||
{ ControlMask, Button4, zoom, {.f = zoomrate * +1} },
|
||||
{ ControlMask, Button4, zoom, {.f = zoomrate * +1} },
|
||||
{ ControlMask, Button5, zoom, {.f = zoomrate * -1} },
|
||||
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
|
||||
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
|
||||
|
|
@ -248,8 +248,6 @@ static Shortcut shortcuts[] = {
|
|||
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
|
||||
{ TERMMOD, XK_Up, zoom, {.f = +1 * zoomrate} },
|
||||
{ TERMMOD, XK_Down, zoom, {.f = -1 * zoomrate} },
|
||||
{ TERMMOD, XK_0, zoomreset, {.f = 0} },
|
||||
{ TERMMOD, XK_parenright, zoomreset, {.f = 0} },
|
||||
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
|
||||
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
|
||||
{ TERMMOD, XK_V, clippaste, {.i = 0} },
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# st version
|
||||
VERSION = 0.9.2
|
||||
VERSION = 0.9
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
|
|
|
|||
14
st.c
14
st.c
|
|
@ -1386,7 +1386,6 @@ csiparse(void)
|
|||
{
|
||||
char *p = csiescseq.buf, *np;
|
||||
long int v;
|
||||
int sep = ';'; /* colon or semi-colon, but not both */
|
||||
|
||||
csiescseq.narg = 0;
|
||||
if (*p == '?') {
|
||||
|
|
@ -1404,9 +1403,7 @@ csiparse(void)
|
|||
v = -1;
|
||||
csiescseq.arg[csiescseq.narg++] = v;
|
||||
p = np;
|
||||
if (sep == ';' && *p == ':')
|
||||
sep = ':'; /* allow override to colon once */
|
||||
if (*p != sep || csiescseq.narg == ESC_ARG_SIZ)
|
||||
if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
|
|
@ -1897,7 +1894,7 @@ csihandle(void)
|
|||
ttywrite(vtiden, strlen(vtiden), 0);
|
||||
break;
|
||||
case 'b': /* REP -- if last char is printable print it <n> more times */
|
||||
LIMIT(csiescseq.arg[0], 1, 65535);
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
if (term.lastc)
|
||||
while (csiescseq.arg[0]-- > 0)
|
||||
tputc(term.lastc);
|
||||
|
|
@ -1991,7 +1988,6 @@ csihandle(void)
|
|||
}
|
||||
break;
|
||||
case 'S': /* SU -- Scroll <n> line up */
|
||||
if (csiescseq.priv) break;
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
/* xterm, urxvt, alacritty save this in history */
|
||||
tscrollup(term.top, term.bot, csiescseq.arg[0], SCROLL_SAVEHIST);
|
||||
|
|
@ -2642,7 +2638,6 @@ eschandle(uchar ascii)
|
|||
treset();
|
||||
resettitle();
|
||||
xloadcols();
|
||||
xsetmode(0, MODE_HIDE);
|
||||
break;
|
||||
case '=': /* DECPAM -- Application keypad */
|
||||
xsetmode(1, MODE_APPKEYPAD);
|
||||
|
|
@ -2791,10 +2786,7 @@ check_control_code:
|
|||
}
|
||||
|
||||
if (term.c.x+width > term.col) {
|
||||
if (IS_SET(MODE_WRAP))
|
||||
tnewline(1);
|
||||
else
|
||||
tmoveto(term.col - width, term.c.y);
|
||||
tnewline(1);
|
||||
gp = &term.line[term.c.y][term.c.x];
|
||||
}
|
||||
|
||||
|
|
|
|||
4
st.info
4
st.info
|
|
@ -184,10 +184,6 @@ st-mono| simpleterm monocolor,
|
|||
# XTerm extensions
|
||||
rmxx=\E[29m,
|
||||
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.
|
||||
# rep=%p1%c\E[%p2%{1}%-%db,
|
||||
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
|
||||
|
|
|
|||
21
x.c
21
x.c
|
|
@ -839,7 +839,7 @@ xloadcols(void)
|
|||
int
|
||||
xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
|
||||
{
|
||||
if (!BETWEEN(x, 0, dc.collen - 1))
|
||||
if (!BETWEEN(x, 0, dc.collen))
|
||||
return 1;
|
||||
|
||||
*r = dc.col[x].color.red >> 8;
|
||||
|
|
@ -854,7 +854,7 @@ xsetcolorname(int x, const char *name)
|
|||
{
|
||||
Color ncolor;
|
||||
|
||||
if (!BETWEEN(x, 0, dc.collen - 1))
|
||||
if (!BETWEEN(x, 0, dc.collen))
|
||||
return 1;
|
||||
|
||||
if (!xloadcolor(x, name, &ncolor))
|
||||
|
|
@ -1158,7 +1158,7 @@ xinit(int cols, int rows)
|
|||
{
|
||||
XGCValues gcvalues;
|
||||
Cursor cursor;
|
||||
Window parent, root;
|
||||
Window parent;
|
||||
pid_t thispid = getpid();
|
||||
XColor xmousefg, xmousebg;
|
||||
|
||||
|
|
@ -1193,19 +1193,16 @@ xinit(int cols, int rows)
|
|||
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
|
||||
xw.attrs.colormap = xw.cmap;
|
||||
|
||||
root = XRootWindow(xw.dpy, xw.scr);
|
||||
if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
|
||||
parent = root;
|
||||
xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t,
|
||||
parent = XRootWindow(xw.dpy, xw.scr);
|
||||
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
|
||||
win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
|
||||
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
|
||||
| CWEventMask | CWColormap, &xw.attrs);
|
||||
if (parent != root)
|
||||
XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t);
|
||||
|
||||
memset(&gcvalues, 0, sizeof(gcvalues));
|
||||
gcvalues.graphics_exposures = False;
|
||||
dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures,
|
||||
dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
|
||||
&gcvalues);
|
||||
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
|
||||
DefaultDepth(xw.dpy, xw.scr));
|
||||
|
|
@ -1671,9 +1668,6 @@ xseticontitle(char *p)
|
|||
XTextProperty prop;
|
||||
DEFAULT(p, opt_title);
|
||||
|
||||
if (p[0] == '\0')
|
||||
p = opt_title;
|
||||
|
||||
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
|
||||
&prop) != Success)
|
||||
return;
|
||||
|
|
@ -1688,9 +1682,6 @@ xsettitle(char *p)
|
|||
XTextProperty prop;
|
||||
DEFAULT(p, opt_title);
|
||||
|
||||
if (p[0] == '\0')
|
||||
p = opt_title;
|
||||
|
||||
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
|
||||
&prop) != Success)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue