Compare commits

..

No commits in common. "master" and "dev" have entirely different histories.
master ... dev

10 changed files with 1922 additions and 1765 deletions

View File

@ -1,28 +1,14 @@
matrix:
# PLATFORM:
# - linux/amd64
# - linux/arm64
ARCH:
# tuur
- tigerlake
# cenny
- skylake
branches: master
platform: linux/amd64
when:
event: push
pipeline:
build:
image: 'menci/archlinuxarm:base-devel'
image: 'archlinux:latest'
commands:
# Add my bur repo to pacman for the libxft-bgra dependency
- echo -e '[bur]\nServer = https://arch.r8r.be/$repo/$arch\nSigLevel = Optional' >> /etc/pacman.conf
# Update packages
- pacman -Syu --noconfirm
- pacman -Syu --needed --noconfirm base-devel
# Create non-root user to perform build & switch to their home
- groupadd -g 1000 builder
- useradd -mg builder builder
@ -30,16 +16,12 @@ pipeline:
- "echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
- su builder
# Build the package
- >
MAKEFLAGS="-j$(nproc)"
makepkg -s --noconfirm --needed
CFLAGS+=" -O3 -flto -march=${ARCH} -mtune=${ARCH}"
CARCH="x86_64_${ARCH}"
- MAKEFLAGS="-j$(nproc)" makepkg -s --noconfirm --needed
publish:
image: 'curlimages/curl'
image: 'archlinux:latest'
commands:
# Publish the package
- 'curl --fail -s -XPOST -H "Authorization: Bearer $API_KEY" -T "$(ls *.pkg*)" https://arch2.r8r.be/jjr'
- 'curl -F "file=@$(ls *.pkg*)" -H "X-API-KEY: $API_KEY" https://pkgs.rustybever.be/api/publish'
secrets:
- api_key

3
FAQ
View File

@ -248,6 +248,3 @@ fonts:
Please don't bother reporting this bug to st, but notify the upstream Xft
developers about fixing this bug.
As of 2022-09-05 this now seems to be finally fixed in libXft 2.3.5:
https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS

View File

@ -1,6 +1,6 @@
MIT/X Consortium License
© 2014-2022 Hiltjo Posthuma <hiltjo at codemadness dot org>
© 2014-2020 Hiltjo Posthuma <hiltjo at codemadness dot org>
© 2018 Devin J. Pohly <djpohly at gmail dot com>
© 2014-2017 Quentin Rameau <quinq at fifth dot space>
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com>

View File

@ -49,7 +49,7 @@ install: st
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
# tic -sx st.info
tic -sx st.info
@echo Please see the README file regarding the terminfo entry of st.
uninstall:

View File

@ -1,65 +1,43 @@
# Maintainer: Jef Roosens
pkgname=jjr-st
pkgver=0.9.2
pkgver=0.8.5
pkgrel=1
pkgdesc="Chewing_Bever's personal build of the st terminal"
pkgdesc="My build of the st terminal"
arch=("x86_64")
url="https://git.rustybever.be/Chewing_Bever/st"
license=("MIT")
arch=(
"x86_64"
"x86_64_tigerlake"
"x86_64_skylake"
"aarch64"
)
depends=("glibc" "libxft-bgra")
makedepends=("gcc")
depends=("libxft")
makedepends=("clang")
provides=("st")
conflicts=("st" "st-git")
source=("arg.h" "boxdraw.c" "boxdraw_data.h" "config.def.h" "config.h"
"config.mk" "hb.c" "hb.h" "LICENSE" "Makefile" "st.1" "st.c" "st.h" "st.info"
"win.h" "x.c" "README")
sha256sums=('1a10fac42d03b3a1231cd6998a73fb4ab4f191694628953e7229f6de2053a985'
'e8366b6b7840759157761b4d311028fa29b846f393b9e928a2587b3ac9bffdd1'
'808dbefe40e81b88da173985e1bd5c0a0d88d517b7cc1c6d68753e586ffe1698'
'49bff578b6c882123393c867689f4330d6ba7cfe85fe359ea7424b228b22970e'
'6fa7874b83e98a30e8c66c8f7d5539d1b2ec6c2267ef2c3945620826187b6b64'
'2ac9d7e18c87595165dffdcedc96c2355d74778667a0770e5079d740cb50ce0c'
'f4fae0ee42168f492ea59825928d1dbaceae5cf9e6fe2f820a429a68266000c7'
'4a133d16a818379ab849b41c30cb4b4f989a00c9b1e96907a4d130d12c36a79e'
'5c25b701b4482ccc8d5ea0770e553ad8a8c5c87650df07543b3b3f9456726d54'
'20459f3d01ba1750c55764c0554a7aebcfad74f8f359c6cc30848c691483c2ef'
'5b0d65d135fcc3d51f60e4fe4d86c5bbd1331266f9b38ecfb86914668c03921c'
'24f5497597f2704e22ba58891c6a3502e391755eed5e8cbd7dfe875fef63b43c'
'285b883ebd0884467be95562885f4cf594cd72cf7b4925476538483fe4022f39'
'2eb2f15957b8132a2d25129c24bb97f64657bd821447f36ef2cf0526b42846e8'
'c1f30d9d38828194c25fa943978a4ee766fe77294e98cea0e4fffa81756bddad'
'ad0cfcd7242682a05421788163aefe45164005f7916cc29a4dc60c4d74005805'
'f767c242485eb537f0df13cbcc182980d29152a6e25036cf65f334fb3ae8b29e')
sha512sums=('53846896087eee0242e3679e8f35be8330e5de63b0247876ac368cf13f62b03c564f99957d49c7f9a7b74cc5190a32b034955d7bf633cc2848da266d7a7f1786'
'031a4bcec190b6e8dbc64e604674f5b754ecc2a79d63f0bb1d9bfe7c79bcb17ee3f36440dd55580e5b238e5e4bf808aa0f0f65cf00072f47d8c9851df06e6489'
'19d9d5414d78d5cc59a080e7f9955e02420c1d18268299160cb4bcb156c6cb0d0cbcf16a9e20094b67cfba3b721a4bfb71223d772c37238a9390388b00eb8919'
'0dba6f78e020f6b51acbd5b19a1e6d62ce990fcbe5a0d5f49eca065cc5f4600dad1222be282c01daf08a213d16e45dcd96497ff686b1bc5cc5e8996b5cda9864'
'bf0d3f0cbeb07b7268c8e08331cb3a82ee438d8414a62233a0accc3966ff96cc37da932ab17fda9a8d560446e4e2c931bd62af0c1e8eb84447ccf48774ee92db'
'c5a6dda87f542378261327ae53f8c6c8ef9cc35575f10c51291d4b36fed47ced77bec7b136fbf2c678794501d34f35911f740ee2b50b30af2e52c9baf393407f'
'd847eb005da53e8938379854017451fc716c15228ffccd7a75b75cbccb6259371ec233ddbdd5fefdacd28e0b5aaad41d163358732bdbefb9178678b637bf050c'
'e287b76dfd1cb6930bdc3c74a77888b6f7e2309c24bf9466c65425418dcff8e977649c71a0ca0ce8c118901d4e81c3781f60324df8394ceee12dae9c7875dc02'
'60bda0e2668626949c4d70ce338c03ce8e2d0f98544ca7053f3061111506a3d8426357253982e56140bb005b6f3a3a383086d9b58a40d4dbd79a6bee9ec2677f'
'81259bdec9c42cbdffd12913672af141095b5c49be4c8d19951bd2a5dc4f2c525b7923579561c3259cb9b58d9f24b04d5e846ff4308a759c92e6eda12adb7b01'
'3e9378413277f344d46056e72c2cf19a3f68ed3175fcaa177a6a0c90d3ff6282d3cb423aa98d32fed9647d2be8cbd52b8adb6f73f87186e95d81320e90fc185d'
'ce7d57550c1fd4731ec0adac11f2fcc6a163524bbdf72359ed544062226ce8775c5bb909e31f4bc92643442bd46be4061ade23d5dd356ad745bea9e59b8536d0'
'c6f08ba53ea59c74b35f889a183feca2a124d46654a6f0556fb181c3843d7d11f9174a934ce01de630c46be2caf705c9ae636f3e59f9762079c3c821652cea87'
'683b40e8d7173ec8d84e2d53454e5111f2effce0c27641e010da1bcec7ee169bfad46142e01893b5e66df87f109bc1afeb944cbae5ce56aa55bfc2544d04e87a'
'28234c79599248929c85936c68ab68f977a722069c51424ae0faa92eddd5d4bf9fc75df0f4a509704ae5b56a2be13481883d675627c4e7fd47f6320a70d259ea'
'4cb372dd9b5711242bce1b82008f9b7c2cfae59c4d2f378df20a88134b61b050aa8f000b01e6e1c0195c14967111497974d67104c1895afb75065d2b6f461255'
'd345c041854864ff8c21cbc5c934d3b5dda2fc7f97eee484d8cee4f3c8671ba5f2dcecad313a199e750a2d64d4e0dfbe9a6033d0ea701c1f9d9b6753502bf72b')
source=("arg.h" "boxdraw.c" "boxdraw.o" "boxdraw_data.h" "config.def.h" "config.h" "config.mk" "hb.c" "hb.h" "hb.o" "LICENSE" "Makefile" "st.1" "st.c" "st.h" "st.info" "win.h" "x.c" "x.o" "README")
md5sums=('7a0155e070d14041f69ca4466aad18bf'
'67a7923385b308ab714a66a81e2803f5'
'977a6000f83c90e69b2dde8288128dcf'
'54322cef62604ce8c288b3d2d20f1baa'
'ce86c3890ce6cc520f7d895c44089a7e'
'34a60a679fdc80ab649982ca014b8883'
'db3ef406027a4e75e6ddb50b986caa52'
'f6fcbd03c6f1013e4f592278bf96086d'
'704b67624d026f76577ce51d021ef00a'
'b581e688384ca1f3d93c18e6933e3f9d'
'04c3ca13a702147c62db90f556c5b3ca'
'84025d924d1ddf176f8dc028bc5f6453'
'bafec1da6c9f80fffd25dd5a85004b42'
'ef77a180cc99be9226e8296e5ae3ada5'
'4f1e1612b1e43442b34bb0fb44254af0'
'0cbfe790d927cce15ae8e658de03f8aa'
'ab9cbb2f172fd88c3c0d8a87eb7bd666'
'63ed863d96f9571cbdb50664b3e70001'
'661a69b61e9da7b94bb0e4abd22fe365'
'd344c31a3b60c2a3ba1c84b914dd2509')
build() {
make CFLAGS="$CFLAGS"
make
}
package() {
@ -73,5 +51,3 @@ package() {
# install $installopts "$docdir" README.terminfo.rst
# install $installopts "$shrdir/$pkgname" "$_sourcedir/st.info"
}
# vim: ft=bash

View File

@ -9,7 +9,7 @@ static char *font = "Fira Code:size=10:antialias=true;autohint=true";
static char *font2[] = {
"Noto Color Emoji:size=10:antialias=true;autohint=true"
};
static int borderpx = 0;
static int borderpx = 2;
float alpha = 0.7;
/* Lines to move per scroll */

View File

@ -1,5 +1,5 @@
# st version
VERSION = 0.9.2
VERSION = 0.8.5
# Customize below to fit your system
@ -24,16 +24,14 @@ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender\
# flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
CFLAGS = -O1
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)
# OpenBSD:
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
# `$(PKG_CONFIG) --libs fontconfig` \
# `$(PKG_CONFIG) --libs freetype2`
#MANPREFIX = ${PREFIX}/man
# compiler and linker
CC = cc
CC = clang

144
st.c
View File

@ -168,7 +168,6 @@ static void csidump(void);
static void csihandle(void);
static void csiparse(void);
static void csireset(void);
static void osc_color_response(int, int, int);
static int eschandle(uchar);
static void strdump(void);
static void strhandle(void);
@ -357,10 +356,25 @@ utf8validate(Rune *u, size_t i)
return i;
}
static const char base64_digits[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0,
63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, -1, 0, 0, 0, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
char
base64dec_getc(const char **src)
{
while (**src && !isprint((unsigned char)**src))
while (**src && !isprint(**src))
(*src)++;
return **src ? *((*src)++) : '='; /* emulate padding if string ends */
}
@ -370,13 +384,6 @@ base64dec(const char *src)
{
size_t in_len = strlen(src);
char *result, *dst;
static const char base64_digits[256] = {
[43] = 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0,
0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
};
if (in_len % 4)
in_len += 4 - (in_len % 4);
@ -949,7 +956,7 @@ ttyresize(int tw, int th)
}
void
ttyhangup(void)
ttyhangup()
{
/* Send SIGHUP to shell */
kill(pid, SIGHUP);
@ -1839,18 +1846,11 @@ csihandle(void)
case 'm': /* SGR -- Terminal attribute (color) */
tsetattr(csiescseq.arg, csiescseq.narg);
break;
case 'n': /* DSR -- Device Status Report */
switch (csiescseq.arg[0]) {
case 5: /* Status Report "OK" `0n` */
ttywrite("\033[0n", sizeof("\033[0n") - 1, 0);
break;
case 6: /* Report Cursor Position (CPR) "<row>;<column>R" */
case 'n': /* DSR Device Status Report (cursor position) */
if (csiescseq.arg[0] == 6) {
len = snprintf(buf, sizeof(buf), "\033[%i;%iR",
term.c.y+1, term.c.x+1);
term.c.y+1, term.c.x+1);
ttywrite(buf, len, 0);
break;
default:
goto unknown;
}
break;
case 'r': /* DECSTBM -- Set Scrolling Region */
@ -1913,28 +1913,39 @@ csireset(void)
}
void
osc_color_response(int num, int index, int is_osc4)
osc4_color_response(int num)
{
int n;
char buf[32];
unsigned char r, g, b;
if (xgetcolor(is_osc4 ? num : index, &r, &g, &b)) {
fprintf(stderr, "erresc: failed to fetch %s color %d\n",
is_osc4 ? "osc4" : "osc",
is_osc4 ? num : index);
if (xgetcolor(num, &r, &g, &b)) {
fprintf(stderr, "erresc: failed to fetch osc4 color %d\n", num);
return;
}
n = snprintf(buf, sizeof buf, "\033]%s%d;rgb:%02x%02x/%02x%02x/%02x%02x\007",
is_osc4 ? "4;" : "", num, r, r, g, g, b, b);
if (n < 0 || n >= sizeof(buf)) {
fprintf(stderr, "error: %s while printing %s response\n",
n < 0 ? "snprintf failed" : "truncation occurred",
is_osc4 ? "osc4" : "osc");
} else {
ttywrite(buf, n, 1);
n = snprintf(buf, sizeof buf, "\033]4;%d;rgb:%02x%02x/%02x%02x/%02x%02x\007",
num, r, r, g, g, b, b);
ttywrite(buf, n, 1);
}
void
osc_color_response(int index, int num)
{
int n;
char buf[32];
unsigned char r, g, b;
if (xgetcolor(index, &r, &g, &b)) {
fprintf(stderr, "erresc: failed to fetch osc color %d\n", index);
return;
}
n = snprintf(buf, sizeof buf, "\033]%d;rgb:%02x%02x/%02x%02x/%02x%02x\007",
num, r, r, g, g, b, b);
ttywrite(buf, n, 1);
}
void
@ -1942,11 +1953,6 @@ strhandle(void)
{
char *p = NULL, *dec;
int j, narg, par;
const struct { int idx; char *str; } osc_table[] = {
{ defaultfg, "foreground" },
{ defaultbg, "background" },
{ defaultcs, "cursor" }
};
term.esc &= ~(ESC_STR_END|ESC_STR);
strparse();
@ -1981,22 +1987,43 @@ strhandle(void)
}
return;
case 10:
if (narg < 2)
break;
p = strescseq.args[1];
if (!strcmp(p, "?"))
osc_color_response(defaultfg, 10);
else if (xsetcolorname(defaultfg, p))
fprintf(stderr, "erresc: invalid foreground color: %s\n", p);
else
redraw();
return;
case 11:
if (narg < 2)
break;
p = strescseq.args[1];
if (!strcmp(p, "?"))
osc_color_response(defaultbg, 11);
else if (xsetcolorname(defaultbg, p))
fprintf(stderr, "erresc: invalid background color: %s\n", p);
else
redraw();
return;
case 12:
if (narg < 2)
break;
p = strescseq.args[1];
if ((j = par - 10) < 0 || j >= LEN(osc_table))
break; /* shouldn't be possible */
if (!strcmp(p, "?")) {
osc_color_response(par, osc_table[j].idx, 0);
} else if (xsetcolorname(osc_table[j].idx, p)) {
fprintf(stderr, "erresc: invalid %s color: %s\n",
osc_table[j].str, p);
} else {
tfulldirt();
}
p = strescseq.args[1];
if (!strcmp(p, "?"))
osc_color_response(defaultcs, 12);
else if (xsetcolorname(defaultcs, p))
fprintf(stderr, "erresc: invalid cursor color: %s\n", p);
else
redraw();
return;
case 4: /* color set */
if (narg < 3)
@ -2006,13 +2033,11 @@ strhandle(void)
case 104: /* color reset */
j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
if (p && !strcmp(p, "?")) {
osc_color_response(j, 0, 1);
} else if (xsetcolorname(j, p)) {
if (par == 104 && narg <= 1) {
xloadcols();
if (p && !strcmp(p, "?"))
osc4_color_response(j);
else if (xsetcolorname(j, p)) {
if (par == 104 && narg <= 1)
return; /* color reset without parameter */
}
fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
j, p ? p : "(null)");
} else {
@ -2020,7 +2045,7 @@ strhandle(void)
* TODO if defaultbg color is changed, borders
* are dirty
*/
tfulldirt();
redraw();
}
return;
}
@ -2492,9 +2517,6 @@ check_control_code:
* they must not cause conflicts with sequences.
*/
if (control) {
/* in UTF-8 mode ignore handling C1 control characters */
if (IS_SET(MODE_UTF8) && ISCONTROLC1(u))
return;
tcontrolcode(u);
/*
* control codes are not shown ever
@ -2541,10 +2563,8 @@ check_control_code:
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));
gp->mode &= ~ATTR_WIDE;
}
if (term.c.x+width > term.col) {
tnewline(1);

1
win.h
View File

@ -30,7 +30,6 @@ void xdrawline(Line, int, int, int);
void xfinishdraw(void);
void xloadcols(void);
int xsetcolorname(int, const char *);
int xgetcolor(int, unsigned char *, unsigned char *, unsigned char *);
void xseticontitle(char *);
void xsettitle(char *);
int xsetcursor(int);

3417
x.c

File diff suppressed because it is too large Load Diff