Compare commits

..

14 Commits

Author SHA1 Message Date
celso 9aa119dc5b made font bigger for new glasses 2024-10-21 13:53:02 -03:00
celso b72575e0ba fixed japanese font issue 2024-10-21 13:53:02 -03:00
celso b9e3a50a5e added keyboard select patch 2024-10-21 13:53:02 -03:00
celso 3a5cb6f5fa added st-mouse-altscreen and st-anysize patches 2024-10-21 13:53:02 -03:00
celso 290270185f added st-scrollback-mouse patch 2024-10-21 13:53:02 -03:00
celso 71e9008164 added st-reflow patch 2024-10-21 13:53:02 -03:00
celso 74f7d621e1 added st-scrollback 2024-10-21 13:53:02 -03:00
celso 636c250557 added st-delkey patch 2024-10-21 13:53:02 -03:00
celso 24b6482415 modified config.mk for asus_desk 2024-10-21 13:53:02 -03:00
Lucas de Sena a0274bc20e fix BadMatch error when embedding on some windows
When embedded, st fails with BadMatch error if the embedder's window has
non-default colormap/depth/visual.  This commit fixes that by creating
st's window inside root and then reparent it into embedder.

The reference window for dc.gc is also changed to match root's visuals.

A similar commit had been made for dmenu[1].
See this issue[2] on github for context.

[1]: https://git.suckless.org/dmenu/commit/0fe460dbd469a1d5b6a7140d0e1801935e4a923b.html
[2]: https://github.com/phillbush/xfiles/issues/47
2024-08-09 13:34:56 +02:00
Hiltjo Posthuma 5dbcca4926 support colons in SGR character attributes
Patch by Mikhail Kot <to@myrrc.dev>
With some modifications to behave more like xterm (see note below).

Example:

	printf '\033[48;2;255:0:0mtest\n'

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Some notes:

"CSI Pm m  Character Attributes (SGR).
[...]
o   xterm allows either colons (standard) or semicolons
(legacy) to separate the subparameters (but after the
first colon, colons must be used).
2024-05-01 20:45:39 +02:00
Hiltjo Posthuma d63b9eb902 bump version to 0.9.2 2024-04-05 12:18:41 +02:00
DOGMAN 497a756382 Reset title when an empty title string is given
With this patch, st will reset its window title when an empty string is
given as the terminal title. For example:
	printf "\033]0;\007"

Some applications, like termdown, expect this functionality. xterm
implements it, but it seems that most other terminal emulators don't.
In any case, I don't see why there should ever be a case where the st
window doesn't have a title property.
2024-04-03 19:49:05 +02:00
Hiltjo Posthuma 8c68ec5241 Revert "Fix cursor move with wide glyphs"
This reverts commit 7473a8d1a5.

This patch needs some more work. It caused regressions with programs that use
GNU readline, etc.

Original test-case example from Tim Culverhouse <tim@timculverhouse.com>:

	printf " 😀" && sleep 2 && printf "\e[D" && sleep 2 && printf "\e[D" && sleep 2

After the patch it caused regressions, example test-case:

	printf "A字\bB\n"
2024-03-30 12:37:06 +01:00
3 changed files with 21 additions and 13 deletions

View File

@ -1,5 +1,5 @@
# st version # st version
VERSION = 0.9.1 VERSION = 0.9.2
# Customize below to fit your system # Customize below to fit your system

15
st.c
View File

@ -112,8 +112,8 @@ enum escape_state {
typedef struct { typedef struct {
Glyph attr; /* current char attributes */ Glyph attr; /* current char attributes */
int x; /* terminal column */ int x;
int y; /* terminal row */ int y;
char state; char state;
} TCursor; } TCursor;
@ -1361,6 +1361,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 == '?') {
@ -1378,7 +1379,9 @@ csiparse(void)
v = -1; v = -1;
csiescseq.arg[csiescseq.narg++] = v; csiescseq.arg[csiescseq.narg++] = v;
p = np; p = np;
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++;
} }
@ -2405,16 +2408,12 @@ tstrsequence(uchar c)
void void
tcontrolcode(uchar ascii) tcontrolcode(uchar ascii)
{ {
size_t i;
switch (ascii) { switch (ascii) {
case '\t': /* HT */ case '\t': /* HT */
tputtab(1); tputtab(1);
return; return;
case '\b': /* BS */ case '\b': /* BS */
for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i) tmoveto(term.c.x-1, term.c.y);
;
tmoveto(term.c.x - i, term.c.y);
return; return;
case '\r': /* CR */ case '\r': /* CR */
tmoveto(0, term.c.y); tmoveto(0, term.c.y);

17
x.c
View File

@ -1235,7 +1235,7 @@ xinit(int cols, int rows)
{ {
XGCValues gcvalues; XGCValues gcvalues;
Cursor cursor; Cursor cursor;
Window parent; Window parent, root;
pid_t thispid = getpid(); pid_t thispid = getpid();
XColor xmousefg, xmousebg; XColor xmousefg, xmousebg;
@ -1275,16 +1275,19 @@ 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)))) if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
parent = XRootWindow(xw.dpy, xw.scr); parent = root;
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t,
win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), 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;
dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures,
&gcvalues); &gcvalues);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
DefaultDepth(xw.dpy, xw.scr)); DefaultDepth(xw.dpy, xw.scr));
@ -1724,6 +1727,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;
@ -1738,6 +1744,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;