st, branch HEADsimple terminal
91c043d124f31f21f7c3e3e3ecfcb87c4c6411032022-04-26T18:50:18Z2022-10-08T09:07:21ZAdd config.hparazydparazyd@dyne.orgcommit 91c043d124f31f21f7c3e3e3ecfcb87c4c641103
parent d7a6be454944e0de0907e03883ee8a0d6e49ed5e
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:50:18 +0200
Add config.h
d7a6be454944e0de0907e03883ee8a0d6e49ed5e2022-04-26T18:50:06Z2022-10-08T09:07:21Zanysizeparazydparazyd@dyne.orgcommit d7a6be454944e0de0907e03883ee8a0d6e49ed5e
parent cc6999c8b6eaa714222eecd519d8212781190ce7
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:50:06 +0200
anysize
cc6999c8b6eaa714222eecd519d8212781190ce72022-04-26T18:48:13Z2022-10-08T09:07:21Zglyph wide supportparazydparazyd@dyne.orgcommit cc6999c8b6eaa714222eecd519d8212781190ce7
parent 97988681134630a84c9824d83027d0f429d427e8
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:48:13 +0200
glyph wide support
97988681134630a84c9824d83027d0f429d427e82022-04-26T18:45:45Z2022-10-08T09:07:20Zplumb selected text with right clickparazydparazyd@dyne.orgcommit 97988681134630a84c9824d83027d0f429d427e8
parent 953e60e96aca92491703ff1cb6aec33f91c0e945
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:45:45 +0200
plumb selected text with right click
953e60e96aca92491703ff1cb6aec33f91c0e9452022-04-26T18:37:09Z2022-10-08T09:07:20Zspoilerparazydparazyd@dyne.orgcommit 953e60e96aca92491703ff1cb6aec33f91c0e945
parent 4764942b579aec913184d9d2c0f9a660b160db7a
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:37:09 +0200
spoiler
4764942b579aec913184d9d2c0f9a660b160db7a2022-04-26T18:36:17Z2022-10-08T09:07:20Zalphaparazydparazyd@dyne.orgcommit 4764942b579aec913184d9d2c0f9a660b160db7a
parent 6cca7457aa2251ce22e0ce49ad1dbf17bbf50ff0
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:36:17 +0200
alpha
6cca7457aa2251ce22e0ce49ad1dbf17bbf50ff02022-04-26T18:30:01Z2022-10-08T09:07:20Zinvertparazydparazyd@dyne.orgcommit 6cca7457aa2251ce22e0ce49ad1dbf17bbf50ff0
parent 68d1ad9b54e952e3079356aeab8ab37e44c56c2c
Author: parazyd <parazyd@dyne.org>
Date: Tue, 26 Apr 2022 20:30:01 +0200
invert
68d1ad9b54e952e3079356aeab8ab37e44c56c2c2022-10-04T17:40:30Z2022-10-04T17:40:30Zbump version to 0.9Hiltjo Posthumahiltjo@codemadness.orgcommit 68d1ad9b54e952e3079356aeab8ab37e44c56c2c
parent 00085199039ee63acc7b1ecb7e3774a9c3552b2a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 4 Oct 2022 19:40:30 +0200
bump version to 0.9
00085199039ee63acc7b1ecb7e3774a9c3552b2a2022-09-16T21:07:09Z2022-09-16T21:07:09ZFAQ: document the color emojis crash issue which affected some systems is fixedHiltjo Posthumahiltjo@codemadness.orgcommit 00085199039ee63acc7b1ecb7e3774a9c3552b2a
parent 72fd32736a612edec43596c14148322122a5544d
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 16 Sep 2022 23:07:09 +0200
FAQ: document the color emojis crash issue which affected some systems is fixed
It is fixed in libXft 2.3.6:
https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS
72fd32736a612edec43596c14148322122a5544d2022-08-18T14:55:19Z2022-08-18T15:14:10Zst: use `void' to indicate an empty parameter listTom Schwindlschwindl@posteo.decommit 72fd32736a612edec43596c14148322122a5544d
parent baa9357e96d2478baa52a3301e70ac80a229b726
Author: Tom Schwindl <schwindl@posteo.de>
Date: Thu, 18 Aug 2022 14:55:19 +0000
st: use `void' to indicate an empty parameter list
baa9357e96d2478baa52a3301e70ac80a229b7262022-05-01T16:38:40Z2022-05-01T16:38:40ZMakefile: add manual path for OpenBSDHiltjo Posthumahiltjo@codemadness.orgcommit baa9357e96d2478baa52a3301e70ac80a229b726
parent 8629d9a1da72cc18568a8f146307b0e939b77ebf
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 1 May 2022 18:38:40 +0200
Makefile: add manual path for OpenBSD
8629d9a1da72cc18568a8f146307b0e939b77ebf2022-01-07T17:21:04Z2022-04-19T09:43:37Zcode-golfing: cleanup osc color related codeNRKnrk@disroot.orgcommit 8629d9a1da72cc18568a8f146307b0e939b77ebf
parent ef0551932fb162f907b40185d2f48c3b497708ee
Author: NRK <nrk@disroot.org>
Date: Fri, 7 Jan 2022 23:21:04 +0600
code-golfing: cleanup osc color related code
* adds missing function prototype
* move xgetcolor() prototype to win.h (that's where all the other x.c
func prototype seems to be declared at)
* check for snprintf error/truncation
* reduces code duplication for osc 10/11/12
* unify osc_color_response() and osc4_color_response() into a single function
the latter two was suggested by Quentin Rameau in his patch review on
the hackers list.
ef0551932fb162f907b40185d2f48c3b497708ee2022-03-18T11:03:34Z2022-03-18T11:20:27Zbase64_digits: reduce scope, implicit zero, +1 sizeNRKnrk@disroot.orgcommit ef0551932fb162f907b40185d2f48c3b497708ee
parent af3bb68add1c40d19d0dee382009e21b0870a38f
Author: NRK <nrk@disroot.org>
Date: Fri, 18 Mar 2022 17:03:34 +0600
base64_digits: reduce scope, implicit zero, +1 size
the array is not accessed outside of base64dec() so it makes sense to
limit it's scope to the related function. the static-storage duration of
the array is kept intact.
this also removes unnecessary explicit zeroing from the start and end of
the array. anything that wasn't explicitly zero-ed will now be
implicitly zero-ed instead.
the validity of the new array can be easily confirmed via running this
trivial loop:
for (int i = 0; i < 255; ++i)
assert(base64_digits[i] == base64_digits_old[i]);
lastly, as pointed out by Roberto, the array needs to have 256 elements
in order to able access it as any unsigned char as an index; the
previous array had 255.
however, this array will only be accessed at indexes which are
isprint() || '=' (see `base64dec_getc()`), so reducing the size of the
array to the highest printable ascii char (127 AFAIK) + 1 might also be
a valid strategy.
af3bb68add1c40d19d0dee382009e21b0870a38f2022-03-18T10:20:54Z2022-03-18T11:11:27Zavoid potential UB when using isprint()NRKnrk@disroot.orgcommit af3bb68add1c40d19d0dee382009e21b0870a38f
parent 2aefa348baf4b702fdce98eb105bcba175d8283f
Author: NRK <nrk@disroot.org>
Date: Fri, 18 Mar 2022 16:20:54 +0600
avoid potential UB when using isprint()
all the ctype.h functions' argument must be representable as an unsigned
char or as EOF, otherwise the behavior is undefined.
2aefa348baf4b702fdce98eb105bcba175d8283f2022-03-13T09:44:08Z2022-03-13T09:45:34Zmake underlines and strikethroughs respect `chscale`Zacchary Dempsey-Plantezacc@ztdp.cacommit 2aefa348baf4b702fdce98eb105bcba175d8283f
parent e823e2308f2a99023032a3966ebb7036a31d305f
Author: Zacchary Dempsey-Plante <zacc@ztdp.ca>
Date: Sun, 13 Mar 2022 10:44:08 +0100
make underlines and strikethroughs respect `chscale`
e823e2308f2a99023032a3966ebb7036a31d305f2022-02-17T14:00:47Z2022-02-18T12:03:37ZDelay redrawals on palette changesSanttu Lakkalainz@inz.ficommit e823e2308f2a99023032a3966ebb7036a31d305f
parent 2c5edf28ec851907305d73c6218ce75d39f1767f
Author: Santtu Lakkala <inz@inz.fi>
Date: Thu, 17 Feb 2022 16:00:47 +0200
Delay redrawals on palette changes
Build on auto-sync and only mark window dirty on palette changes and let
the event handler do the actual draw.
2c5edf28ec851907305d73c6218ce75d39f1767f2022-01-12T08:44:27Z2022-01-12T08:44:27ZX10/SGR mouse: use alt as meta key instead of super/windows keyHiltjo Posthumahiltjo@codemadness.orgcommit 2c5edf28ec851907305d73c6218ce75d39f1767f
parent b1d97fec47b0d6633addb848131388ec40154ebc
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 12 Jan 2022 09:44:27 +0100
X10/SGR mouse: use alt as meta key instead of super/windows key
b1d97fec47b0d6633addb848131388ec40154ebc2022-01-10T16:11:17Z2022-01-10T16:11:17ZLICENSE: bump yearHiltjo Posthumahiltjo@codemadness.orgcommit b1d97fec47b0d6633addb848131388ec40154ebc
parent ea7cd7b62fdfa6a1fbd882d1565d557577f2cf32
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 10 Jan 2022 17:11:17 +0100
LICENSE: bump year
ea7cd7b62fdfa6a1fbd882d1565d557577f2cf322022-01-08T19:40:34Z2022-01-10T16:04:01ZFix mousereportrobertrobertrussell.72001@gmail.comcommit ea7cd7b62fdfa6a1fbd882d1565d557577f2cf32
parent 7fb0c0cc681f36be2ad12091ef93a41671f32738
Author: robert <robertrussell.72001@gmail.com>
Date: Sat, 8 Jan 2022 11:40:34 -0800
Fix mousereport
This patch replaces the previous one I sent.
The following changes are made in this patch:
- Fix tracking of pressed buttons. Previously, pressing two buttons and
then releasing one would make st think no buttons are pressed, which
in particular broke MODE_MOUSEMOTION.
- Always send the lowest-numbered pressed button on motion events; when
no button is pressed for a motion event in MODE_MOUSEMANY, then send
a release. This matches the behaviour of xterm. (Previously, st sent
the most recently pressed button in the motion report.)
- Remove UB (?) access to potentially inactive struct member
e->xbutton.button of XEvent union.
- Fix (unlikely) possibility of overflow for large button numbers.
The one discrepancy I found between st and xterm is that xterm sometimes
encodes buttons with large numbers (>5) strangely. E.g., xterm reports
presses of buttons 8 and 9 as releases, whereas st properly (?) encodes
them as presses.
7fb0c0cc681f36be2ad12091ef93a41671f327382022-01-07T11:39:57Z2022-01-07T11:39:57Zbump version to 0.8.5Hiltjo Posthumahiltjo@codemadness.orgcommit 7fb0c0cc681f36be2ad12091ef93a41671f32738
parent 7e1c68f25d9f08687a94eeef8d7f8ffd0d14b911
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 7 Jan 2022 12:39:57 +0100
bump version to 0.8.5
7e1c68f25d9f08687a94eeef8d7f8ffd0d14b9112022-01-02T11:15:45Z2022-01-02T11:16:57ZFAQ: fix a typo, patch -> pathHiltjo Posthumahiltjo@codemadness.orgcommit 7e1c68f25d9f08687a94eeef8d7f8ffd0d14b911
parent 65f1dc428315ae9d7f362e10c668557c1379e7af
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 2 Jan 2022 12:15:45 +0100
FAQ: fix a typo, patch -> path
65f1dc428315ae9d7f362e10c668557c1379e7af2021-12-29T17:07:17Z2021-12-30T17:37:17ZFix overtyping wide characters.jaminacdimalev@gmail.comcommit 65f1dc428315ae9d7f362e10c668557c1379e7af
parent a0467c802d4f86ed162486e3453dd61181423902
Author: jamin <acdimalev@gmail.com>
Date: Wed, 29 Dec 2021 09:07:17 -0800
Fix overtyping wide characters.
Overtyping the first half of a wide character with the
second half of a wide character results in display garbage.
This is because the trailing dummy is not cleaned up.
i.e. ATTR_WIDE, ATTR_WDUMMY, ATTR_WDUMMY
Here is a short script for demonstrating the behavior:
#!/bin/sh
alias printf=/usr/bin/printf
printf こんにちは!; sleep 2
printf '\x1b[5D'; sleep 2
printf へ; sleep 2
printf ' '; sleep 2
echo
a0467c802d4f86ed162486e3453dd611814239022021-12-27T10:41:42Z2021-12-27T12:07:11ZFix null pointer access in strhandleJochen Sprickerhofgit@jochen.sprickerhof.decommit a0467c802d4f86ed162486e3453dd61181423902
parent 273db5ceaf392e68c2faf8f7dec14ea2e25e980d
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Mon, 27 Dec 2021 11:41:42 +0100
Fix null pointer access in strhandle
According to the spec the argument is optional for 104, so p can be
NULL as can be tested with printf '\x1b]104\x07'. This is a regression
of 8e31030.
273db5ceaf392e68c2faf8f7dec14ea2e25e980d2021-12-26T18:00:41Z2021-12-26T18:00:41Zfollow-up fix for OSC color sequences, returnHiltjo Posthumahiltjo@codemadness.orgcommit 273db5ceaf392e68c2faf8f7dec14ea2e25e980d
parent 8e310303903792c010d03c046ba75f8b18f7d3a7
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 26 Dec 2021 19:00:41 +0100
follow-up fix for OSC color sequences, return
Otherwise the message "erresc: unknown str" is printed.
8e310303903792c010d03c046ba75f8b18f7d3a72021-12-26T17:57:04Z2021-12-26T17:57:44ZAdd support for OSC color sequencesRaheman Vaiyar.vaiya@gmail.comcommit 8e310303903792c010d03c046ba75f8b18f7d3a7
parent 2f6e597ed871cff91c627850d03152cae5f45779
Author: Raheman Vaiya <r.vaiya@gmail.com>
Date: Sun, 26 Dec 2021 18:57:04 +0100
Add support for OSC color sequences
2f6e597ed871cff91c627850d03152cae5f457792021-08-24T11:44:35Z2021-08-24T11:44:35Zfix possible rare crash when Xutf8TextPropertyToTextList failsHiltjo Posthumahiltjo@codemadness.orgcommit 2f6e597ed871cff91c627850d03152cae5f45779
parent 1d3142da968da7f6f61f1c1708f39ca233eda150
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 24 Aug 2021 13:44:35 +0200
fix possible rare crash when Xutf8TextPropertyToTextList fails
from the XmbTextListToTextProperty(3) man page:
"If insufficient memory is available for the new value string, the functions
return XNoMemory. If the current locale is not supported, the functions return
XLocaleNotSupported. In both of these error cases, the functions do not set
text_prop_return."
Reported by Steffen Nurpmeso <steffen@sdaoden.eu>, thanks!
1d3142da968da7f6f61f1c1708f39ca233eda1502021-08-23T21:25:05Z2021-08-24T11:30:11Zfix a problem that the standard streams are unexpectedly closedKoichi Murasemyoga.murase@gmail.comcommit 1d3142da968da7f6f61f1c1708f39ca233eda150
parent 2ec571a30c0c3b1a17f6b3631c80d573582f59a1
Author: Koichi Murase <myoga.murase@gmail.com>
Date: Tue, 24 Aug 2021 06:25:05 +0900
fix a problem that the standard streams are unexpectedly closed
In the current implementation, the slave PTY (assigned to the variable
`s') is always closed after duplicating it to file descriptors of
standard streams (0, 1, and 2). However, when the allocated slave PTY
`s' is already one of 0, 1, or 2, this causes unexpected closing of a
standard stream. The same problem occurs when the file descriptor of
the master PTY (the variable `m') is one of 0, 1, or 2.
In this patch, the original master PTY (m) is closed before it would
be overwritten by duplicated slave PTYs. The original slave PTY (s)
is closed only when it is not one of the stanrad streams.
2ec571a30c0c3b1a17f6b3631c80d573582f59a12021-07-17T22:14:00Z2021-07-18T09:44:56ZAdd 14th bit to XK_SWITCH_MOD bitmaskPetar Kaprišpetarkapris@firemail.cccommit 2ec571a30c0c3b1a17f6b3631c80d573582f59a1
parent 4536f46cfff50c66a115755def0155d8e246b02f
Author: Petar Kapriš <petarkapris@firemail.cc>
Date: Sun, 18 Jul 2021 00:14:00 +0200
Add 14th bit to XK_SWITCH_MOD bitmask
The bits of uint signal in an XKeyEvent which concern the key group (keyboard
layout) are bits 13 and 14, as documented here:
https://www.x.org/releases/X11R7.7/doc/libX11/XKB/xkblib.html#Groups_and_Shift_Levels
In the older version, only bit 13 was marked as part of XK_SWITCH_MOD, this
causes issues for users who have more than two keymaps. the 14th bit is not
in ignoremod, key sequences are not caught by match(), if they switch to a third
or fourth keyboard.
4536f46cfff50c66a115755def0155d8e246b02f2021-03-28T19:16:59Z2021-05-06T16:21:10ZMild const-correctness improvements.Markus F.X.J. Oberhumermarkus@oberhumer.comcommit 4536f46cfff50c66a115755def0155d8e246b02f
parent 9e68fdbcdb06dfa3d23fe3a7a7f7b59e40e1ea2f
Author: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Date: Sun, 28 Mar 2021 21:16:59 +0200
Mild const-correctness improvements.
Only touch a few things, the main focus is to
improve code readability.
9e68fdbcdb06dfa3d23fe3a7a7f7b59e40e1ea2f2021-03-19T10:54:36Z2021-03-19T10:58:59Zfix: correctly encode mouse buttons >= 8 in X10 and SGR modeHiltjo Posthumahiltjo@codemadness.orgcommit 9e68fdbcdb06dfa3d23fe3a7a7f7b59e40e1ea2f
parent 4ef0cbd8b9371f37f7d02ef37b5378b879e6b8bf
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 19 Mar 2021 11:54:36 +0100
fix: correctly encode mouse buttons >= 8 in X10 and SGR mode
These are typically mapped in X11 to the side-buttons (backward/forwards) on
the mouse. A comparison of the button numbers in SGR mode (first field):
st old:
0 1 2 64 65 66 67 68 69 70
st new (it is the same as xterm now):
0 1 2 64 65 66 67 128 129 130
A script to test and reproduce it, first argument is "h" (on) or "l" (off):
#!/bin/sh
printf '\x1b[?1000%s\x1b[?1006%s' "$1" "$1"
for n in 1 2 3 4 5 6 7 8 9 10; do
printf 'button %d\n' "$n"
xdotool click "$n"
printf '\n\n'
done
4ef0cbd8b9371f37f7d02ef37b5378b879e6b8bf2020-10-18T09:18:03Z2020-10-18T09:18:03Zremove unused variable from previous patchHiltjo Posthumahiltjo@codemadness.orgcommit 4ef0cbd8b9371f37f7d02ef37b5378b879e6b8bf
parent 28b4c822c5c0acec300fdf15c6e3ede9f5e2335d
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 18 Oct 2020 11:18:03 +0200
remove unused variable from previous patch
28b4c822c5c0acec300fdf15c6e3ede9f5e2335d2020-09-06T05:53:41Z2020-10-18T09:17:11ZST: Add WM_ICON_NAME property supportJohn Collisjohn.collis@alliedtelesis.co.nzcommit 28b4c822c5c0acec300fdf15c6e3ede9f5e2335d
parent fa253f077f19b3220c7655b81bd91e52f4367803
Author: John Collis <john.collis@alliedtelesis.co.nz>
Date: Sun, 6 Sep 2020 17:53:41 +1200
ST: Add WM_ICON_NAME property support
Also added _NET_WM_ICON_NAME.
fa253f077f19b3220c7655b81bd91e52f43678032020-06-19T09:27:17Z2020-06-19T09:27:17Zbump version to 0.8.4Hiltjo Posthumahiltjo@codemadness.orgcommit fa253f077f19b3220c7655b81bd91e52f4367803
parent b27a383a3acc7decf00e6e889fca265430b5d329
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 19 Jun 2020 11:27:17 +0200
bump version to 0.8.4
b27a383a3acc7decf00e6e889fca265430b5d3292020-06-17T21:47:00Z2020-06-17T21:49:40Zconfig.mk: use PKG_CONFIG in commented OpenBSD sectionHiltjo Posthumahiltjo@codemadness.orgcommit b27a383a3acc7decf00e6e889fca265430b5d329
parent 81067c65ea4dd80e8eb34755a4f50a4a8c7df06b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 17 Jun 2020 23:47:00 +0200
config.mk: use PKG_CONFIG in commented OpenBSD section
81067c65ea4dd80e8eb34755a4f50a4a8c7df06b2020-06-17T21:44:34Z2020-06-17T21:49:40ZLICENSE: bump yearsHiltjo Posthumahiltjo@codemadness.orgcommit 81067c65ea4dd80e8eb34755a4f50a4a8c7df06b
parent f74a9df6e1fc88eebe6d673d888b61fd83cf6fc4
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 17 Jun 2020 23:44:34 +0200
LICENSE: bump years
f74a9df6e1fc88eebe6d673d888b61fd83cf6fc42020-06-17T20:05:48Z2020-06-17T21:49:22Zremove sixel stub codeHiltjo Posthumahiltjo@codemadness.orgcommit f74a9df6e1fc88eebe6d673d888b61fd83cf6fc4
parent 818ec746f4caae453d09368b101c3e841cf39870
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 17 Jun 2020 22:05:48 +0200
remove sixel stub code
Remove stub code that was used for an experiment of adding sixel code to st
from the commit f7398434.
818ec746f4caae453d09368b101c3e841cf398702020-06-17T19:35:39Z2020-06-17T19:35:39Zfix unicode glitch in DCS strings, patch by Tim AllenHiltjo Posthumahiltjo@codemadness.orgcommit 818ec746f4caae453d09368b101c3e841cf39870
parent 9ba7ecf7b15ec2986c6142036706aa353b249ef9
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 17 Jun 2020 21:35:39 +0200
fix unicode glitch in DCS strings, patch by Tim Allen
Reported on the mailinglist:
"
I discovered recently that if an application running inside st tries to
send a DCS string, subsequent Unicode characters get messed up. For
example, consider the following test-case:
printf '\303\277\033P\033\\\303\277'
...where:
- \303\277 is the UTF-8 encoding of U+00FF LATIN SMALL LETTER Y WITH
DIAERESIS (ÿ).
- \033P is ESC P, the token that begins a DCS string.
- \033\\ is ESC \, a token that ends a DCS string.
- \303\277 is the same ÿ character again.
If I run the above command in a VTE-based terminal, or xterm, or
QTerminal, or pterm (PuTTY), I get the output:
ÿÿ
...which is to say, the empty DCS string is ignored. However, if I run
that command inside st (as of commit 9ba7ecf), I get:
ÿÿ
...where those last two characters are \303\277 interpreted as ISO8859-1
characters, instead of UTF-8.
I spent some time tracing through the state machines in st.c, and so far
as I can tell, this is how it works currently:
- ESC P sets the "ESC_DCS" and "ESC_STR" flags, indicating that
incoming bytes should be collected into the strescseq buffer, rather
than being interpreted.
- ESC \ sets the "ESC_STR_END" flag (when ESC is received), and then
calls strhandle() (when \ is received) to interpret the collected
bytes.
- If the collected bytes begin with 'P' (i.e. if this was a DCS
string) strhandle() sets the "ESC_DCS" flag again, confusing the
state machine.
If my understanding is correct, fixing the problem should be as easy as
removing the line that sets ESC_DCS from strhandle():
diff --git a/st.c b/st.c
index ef8abd5..b5b805a 100644
--- a/st.c
+++ b/st.c
@@ -1897,7 +1897,6 @@ strhandle(void)
xsettitle(strescseq.args[0]);
return;
case 'P': /* DCS -- Device Control String */
- term.mode |= ESC_DCS;
case '_': /* APC -- Application Program Command */
case '^': /* PM -- Privacy Message */
return;
I've tried the above patch and it fixes my problem, but I don't know if
it introduces any others.
"
9ba7ecf7b15ec2986c6142036706aa353b249ef92020-06-01T12:09:46Z2020-06-01T12:09:46ZFAQ: fix single-buffer patchHiltjo Posthumahiltjo@codemadness.orgcommit 9ba7ecf7b15ec2986c6142036706aa353b249ef9
parent a2a704492b9f4d2408d180f7aeeacf4c789a1d67
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 1 Jun 2020 14:09:46 +0200
FAQ: fix single-buffer patch
rebase against master
a2a704492b9f4d2408d180f7aeeacf4c789a1d672020-05-30T19:56:18Z2020-05-30T20:06:15Zconfig.def.h: add an option allowwindowops, by default off (secure)Hiltjo Posthumahiltjo@codemadness.orgcommit a2a704492b9f4d2408d180f7aeeacf4c789a1d67
parent 0f8b40652bca0670f1f0bda069bbc55f8b5e364d
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 30 May 2020 21:56:18 +0200
config.def.h: add an option allowwindowops, by default off (secure)
Similar to the xterm AllowWindowOps option, this is an option to allow or
disallow certain (non-interactive) operations that can be insecure or
exploited.
NOTE: xsettitle() is not guarded by this because st does not support printing
the window title. Else this could be exploitable (arbitrary code execution).
Similar problems have been found in the past in other terminal emulators.
The sequence for base64-encoded clipboard copy is now guarded because it allows
a sequence written to the terminal to manipulate the clipboard of the running
user non-interactively, for example:
printf '\x1b]52;0;ZWNobyBoaQ0=\a'
0f8b40652bca0670f1f0bda069bbc55f8b5e364d2020-05-30T19:50:54Z2020-05-30T20:05:17ZFAQ: add some details about the w3m img hackHiltjo Posthumahiltjo@codemadness.orgcommit 0f8b40652bca0670f1f0bda069bbc55f8b5e364d
parent e6e2c6199f102f1459b53717050eee27832f4f87
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 30 May 2020 21:50:54 +0200
FAQ: add some details about the w3m img hack
... and an example patch to switch from double-buffering to a single buffer.
e6e2c6199f102f1459b53717050eee27832f4f872020-05-30T19:39:49Z2020-05-30T20:05:17Ztiny style fixHiltjo Posthumahiltjo@codemadness.orgcommit e6e2c6199f102f1459b53717050eee27832f4f87
parent 94b8ec002101a5e8f52a342e53431eea71aa0631
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 30 May 2020 21:39:49 +0200
tiny style fix
94b8ec002101a5e8f52a342e53431eea71aa06312020-05-30T19:34:57Z2020-05-30T20:04:28ZPartially add back in "support REP (repeat) escape sequence"Hiltjo Posthumahiltjo@codemadness.orgcommit 94b8ec002101a5e8f52a342e53431eea71aa0631
parent dec6b530a4fddf405c1822b2cac6e2036d3c8b75
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 30 May 2020 21:34:57 +0200
Partially add back in "support REP (repeat) escape sequence"
Add the functionality back in for xterm compatibility, but do not expose the
capability in st.info (yet).
Some notes:
It was reverted because it caused some issues with ncurses in some
configurations, namely when using BSD padding (--enable-bsdpad, BSD_TPUTS) in
ncurses it caused issues with repeating digits.
A fix has been upstreamed in ncurses since snapshot 20200523. The fix is also
backported to OpenBSD -current.
dec6b530a4fddf405c1822b2cac6e2036d3c8b752020-05-21T02:24:55Z2020-05-24T11:45:42ZCall xsetcursor to set win.cursor in mainSteve Wardplanet36@gmail.comcommit dec6b530a4fddf405c1822b2cac6e2036d3c8b75
parent 475a0a36cb4fda1da30f014da65988e99b222876
Author: Steve Ward <planet36@gmail.com>
Date: Wed, 20 May 2020 22:24:55 -0400
Call xsetcursor to set win.cursor in main
In xsetcursor, remove "DEFAULT(cursor, 1)" because 0 is a valid value.
Increase max allowed value of cursor from 6 to 7 (st extension).
475a0a36cb4fda1da30f014da65988e99b2228762020-05-16T16:06:42Z2020-05-16T19:06:13ZRevert "support REP (repeat) escape sequence"Hiltjo Posthumahiltjo@codemadness.orgcommit 475a0a36cb4fda1da30f014da65988e99b222876
parent e8392b282c2eaa28725241a9612804fb55113da4
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 16 May 2020 18:06:42 +0200
Revert "support REP (repeat) escape sequence"
This reverts commit e8392b282c2eaa28725241a9612804fb55113da4.
There is currently a bug in older ncurses versions (like on OpenBSD) where a
fix for a bug with REP is not backported yet. Most likely in tty/tty_update.c:
Noticed while using lynx (which uses ncurses/curses).
To reproduce using lynx: echo "Z0000000" | lynx -stdin
or using the program:
int
main(void)
{
WINDOW *win;
win = initscr();
printw("Z0000000");
refresh();
sleep(5);
return 0;
}
This prints "ZZZZZZZ" (incorrectly).
e8392b282c2eaa28725241a9612804fb55113da42020-05-14T15:18:07Z2020-05-16T12:08:10Zsupport REP (repeat) escape sequenceAvi Halachmi (:avih)avihpit@yahoo.comcommit e8392b282c2eaa28725241a9612804fb55113da4
parent f8afebdfa0cc9a57b22c39c47e9b585f69453eb7
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Thu, 14 May 2020 18:18:07 +0300
support REP (repeat) escape sequence
The sequence \e[Nb prints the last printed char N (more) times if it's
printable, and it's ignored after newline or other control chars.
This is Ecma-048/ANSI-X3.6 sequence and not DEC VT. It's supported by
xterm, and ncurses uses it when possible, e.g. when TERM is xterm* (and
with this commit also st*).
xterm supports only codepoints<=255, possibly due to internal limits.
We support any value/codepoint which was placed in a cell.
To test:
- tput rep 65 4 -> prints 'AAAA'
- printf "\342\225\246\033[4b" -> prints U+2566 1+4 times.
f8afebdfa0cc9a57b22c39c47e9b585f69453eb72020-05-16T10:42:51Z2020-05-16T12:07:31ZAdd rin terminfo capabilityRoberto E. Vargask0ga@shike2.comcommit f8afebdfa0cc9a57b22c39c47e9b585f69453eb7
parent bda9c9ffa645ee5e4b2507474ebfa1c5efb889b2
Author: Roberto E. Vargas <k0ga@shike2.com>
Date: Sat, 16 May 2020 10:42:51 +0000
Add rin terminfo capability
Tianlin Qu discovered that st is missing rin (scroll back #1 lines).
bda9c9ffa645ee5e4b2507474ebfa1c5efb889b22020-05-16T09:48:18Z2020-05-16T10:37:14ZMake shift+wheel behaves as shift+Prev/Nextk0gak0ga@shike2.comcommit bda9c9ffa645ee5e4b2507474ebfa1c5efb889b2
parent 045a0fab4f80b57f4a982ae6bc5f33fe21d66111
Author: k0ga <k0ga@shike2.com>
Date: Sat, 16 May 2020 09:48:18 +0000
Make shift+wheel behaves as shift+Prev/Next
St uses a very good hack where mouse wheel genereates ^Y and ^E,
that are the same keys that less and vi uses for backward and
fordward scrolling. Scroll, as many terminal emulators, use
shift+Prev/Next for scrolling, but it is also using ^E and ^Y
for scroling, characters that are reserved in the POSIX shell
in emacs mode for end of line and yanking, making scroll unsable
in st.
This patch adds a new hack, making shift+wheel returning the
same sequences than shift+Prev/Next, meaning that scroll or
any other similar program will not be able to differentiate
between them.
045a0fab4f80b57f4a982ae6bc5f33fe21d661112020-05-06T11:36:59Z2020-05-12T13:38:17ZFix selection: selscrollJakub Leszczakszatan@gecc.xyzcommit 045a0fab4f80b57f4a982ae6bc5f33fe21d66111
parent 9c30066e73f0105c3fccb7582c8172d5117857b3
Author: Jakub Leszczak <szatan@gecc.xyz>
Date: Wed, 6 May 2020 13:36:59 +0200
Fix selection: selscroll
9c30066e73f0105c3fccb7582c8172d5117857b32020-05-06T11:35:53Z2020-05-12T13:38:02ZFix selection: ignore ATTR_WRAP when rectangular selection in getselJakub Leszczakszatan@gecc.xyzcommit 9c30066e73f0105c3fccb7582c8172d5117857b3
parent 8304d4f0599b1be2226c28c553547070658d4af3
Author: Jakub Leszczak <szatan@gecc.xyz>
Date: Wed, 6 May 2020 13:35:53 +0200
Fix selection: ignore ATTR_WRAP when rectangular selection in getsel
8304d4f0599b1be2226c28c553547070658d4af32020-05-06T11:35:06Z2020-05-12T13:37:59ZFix selection: selclear in tputcJakub Leszczakszatan@gecc.xyzcommit 8304d4f0599b1be2226c28c553547070658d4af3
parent 914fb825df3bde7abdd7947e54f8bf4d2b55e34e
Author: Jakub Leszczak <szatan@gecc.xyz>
Date: Wed, 6 May 2020 13:35:06 +0200
Fix selection: selclear in tputc
914fb825df3bde7abdd7947e54f8bf4d2b55e34e2020-05-09T12:43:31Z2020-05-09T12:43:31Zcode-style: add fallthrough commentHiltjo Posthumahiltjo@codemadness.orgcommit 914fb825df3bde7abdd7947e54f8bf4d2b55e34e
parent cde480c6939e62771ba3b60ef4eb848031aee9f9
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 May 2020 14:43:31 +0200
code-style: add fallthrough comment
Patch by Steve Ward, thanks.
cde480c6939e62771ba3b60ef4eb848031aee9f92020-05-09T12:03:14Z2020-05-09T12:11:25Zoptimize column width calculation and utf-8 encode for ASCIIHiltjo Posthumahiltjo@codemadness.orgcommit cde480c6939e62771ba3b60ef4eb848031aee9f9
parent 8211e36d281990a39db1853bcd454ac59e53d521
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 May 2020 14:03:14 +0200
optimize column width calculation and utf-8 encode for ASCII
In particular on OpenBSD and on glibc wcwidth() is quite expensive.
On musl there is little difference.
8211e36d281990a39db1853bcd454ac59e53d5212020-05-09T11:56:28Z2020-05-09T12:07:52Zfix for incorrect (partial) written sequences when libc wcwidth() == -1Hiltjo Posthumahiltjo@codemadness.orgcommit 8211e36d281990a39db1853bcd454ac59e53d521
parent 87545c612e8ab6e7cd1ef38e2355d0cb86df79f2
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 May 2020 13:56:28 +0200
fix for incorrect (partial) written sequences when libc wcwidth() == -1
Fix an issue with incorrect (partial) written sequences when libc wcwidth() ==
-1. The sequence is updated to on wcwidth(u) == -1:
c = "\357\277\275"
but len isn't.
A way to reproduce in practise:
* st -o dump.txt
* In the terminal: printf '\xcd\xb8'
- This is codepoint 888, on OpenBSD it reports wcwidth() == -1.
- Quit the terminal.
- Look in dump.txt (partial written sequence of "UTF_INVALID").
This was introduced in:
" commit 11625c7166b7e4dad414606227acec2de1c36464
Author: czarkoff@gmail.com <czarkoff@gmail.com>
Date: Tue Oct 28 12:55:28 2014 +0100
Replace character with U+FFFD if wcwidth() is -1
Helpful when new Unicode codepoints are not recognized by libc."
Change:
Remove setting the sequence. If this happens to break something, another
solution could be setting len = 3 for the sequence.
87545c612e8ab6e7cd1ef38e2355d0cb86df79f22020-05-09T11:55:34Z2020-05-09T12:05:04Ztiny code-style and typo-fix in commentHiltjo Posthumahiltjo@codemadness.orgcommit 87545c612e8ab6e7cd1ef38e2355d0cb86df79f2
parent 1d590910652519268152eae6b97cf30ace4e90c0
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 May 2020 13:55:34 +0200
tiny code-style and typo-fix in comment
1d590910652519268152eae6b97cf30ace4e90c02019-02-26T20:37:49Z2020-05-09T11:53:50Zauto-sync: draw on idle to avoid flicker/tearingAvi Halachmi (:avih)avihpit@yahoo.comcommit 1d590910652519268152eae6b97cf30ace4e90c0
parent d6ea0a1a61853dd892029a7126e7fdb70c371878
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Tue, 26 Feb 2019 22:37:49 +0200
auto-sync: draw on idle to avoid flicker/tearing
st could easily tear/flicker with animation or other unattended
output. This commit eliminates most of the tear/flicker.
Before this commit, the display timing had two "modes":
- Interactively, st was waiting fixed `1000/xfps` ms after forwarding
the kb/mouse event to the application and before drawing.
- Unattended, and specifically with animations, the draw frequency was
throttled to `actionfps`. Animation at a higher rate would throttle
and likely tear, and at lower rates it was tearing big frames
(specifically, when one `read` didn't get a full "frame").
The interactive behavior was decent, but it was impossible to get good
unattended-draw behavior even with carefully chosen configuration.
This commit changes the behavior such that it draws on idle instead of
using fixed latency/frequency. This means that it tries to draw only
when it's very likely that the application has completed its output
(or after some duration without idle), so it mostly succeeds to avoid
tear, flicker, and partial drawing.
The config values minlatency/maxlatency replace xfps/actionfps and
define the range which the algorithm is allowed to wait from the
initial draw-trigger until the actual draw. The range enables the
flexibility to choose when to draw - when least likely to flicker.
It also unifies the interactive and unattended behavior and config
values, which makes the code simpler as well - without sacrificing
latency during interactive use, because typically interactively idle
arrives very quickly, so the wait is typically minlatency.
While it only slighly improves interactive behavior, for animations
and other unattended-drawing it improves greatly, as it effectively
adapts to any [animation] output rate without tearing, throttling,
redundant drawing, or unnecessary delays (sounds impossible, but it
works).
d6ea0a1a61853dd892029a7126e7fdb70c3718782020-04-29T22:10:02Z2020-04-29T23:21:21Zreplace exit(3) by _exit(2) in signal handler sigchld()Jan Klemkowj.klemkow@wemelug.decommit d6ea0a1a61853dd892029a7126e7fdb70c371878
parent 43a395ae91f7d67ce694e65edeaa7bbc720dd027
Author: Jan Klemkow <j.klemkow@wemelug.de>
Date: Thu, 30 Apr 2020 00:10:02 +0200
replace exit(3) by _exit(2) in signal handler sigchld()
exit(3) is not async-signal-safe but, _exit(2) is.
This change prevents st to crash and dump core.
43a395ae91f7d67ce694e65edeaa7bbc720dd0272020-04-27T11:56:25Z2020-04-27T11:56:25Zbump version to 0.8.3Hiltjo Posthumahiltjo@codemadness.orgcommit 43a395ae91f7d67ce694e65edeaa7bbc720dd027
parent 72e3f6c7c05b4d5b56388508bb20a863aec279f5
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 27 Apr 2020 13:56:25 +0200
bump version to 0.8.3
72e3f6c7c05b4d5b56388508bb20a863aec279f52020-04-19T17:38:39Z2020-04-19T17:39:48ZUpdate XIM cursor position only if changedIvan Thampickfire@riseup.netcommit 72e3f6c7c05b4d5b56388508bb20a863aec279f5
parent 33a9a456644ceb235ea6ce61282f3bdce7a8b547
Author: Ivan Tham <pickfire@riseup.net>
Date: Sun, 19 Apr 2020 19:38:39 +0200
Update XIM cursor position only if changed
Updating XIM cursor position is expensive, so only update it when cursor
position changed.
33a9a456644ceb235ea6ce61282f3bdce7a8b5472020-04-11T13:45:06Z2020-04-11T13:45:06Zjust remove the EOF messageHiltjo Posthumahiltjo@codemadness.orgcommit 33a9a456644ceb235ea6ce61282f3bdce7a8b547
parent 771bc401f76b329f78a285ca65355d4b43415172
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 11 Apr 2020 15:45:06 +0200
just remove the EOF message
771bc401f76b329f78a285ca65355d4b434151722020-04-11T12:46:17Z2020-04-11T13:23:23ZAdd st-mono terminfo entryRoberto E. Vargas Caballerok0ga@shike2.comcommit 771bc401f76b329f78a285ca65355d4b43415172
parent d66bd405c0d0f29beff89683a04a10297e962cb9
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 11 Apr 2020 14:46:17 +0200
Add st-mono terminfo entry
This entry is intended for monocolor display and it is very
helpful for color haters.
d66bd405c0d0f29beff89683a04a10297e962cb92020-04-11T11:56:31Z2020-04-11T13:23:23Zconfig.def.h: add a comment for the scroll variableHiltjo Posthumahiltjo@codemadness.orgcommit d66bd405c0d0f29beff89683a04a10297e962cb9
parent e997303502ddd5c26cfc41af0ff5356bffc04359
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 11 Apr 2020 13:56:31 +0200
config.def.h: add a comment for the scroll variable
e997303502ddd5c26cfc41af0ff5356bffc043592020-04-11T11:29:48Z2020-04-11T13:23:23ZFix small typosHiltjo Posthumahiltjo@codemadness.orgcommit e997303502ddd5c26cfc41af0ff5356bffc04359
parent c1145268f6b6c6f03a8bec1c09d356d6a4eba77e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 11 Apr 2020 13:29:48 +0200
Fix small typos
c1145268f6b6c6f03a8bec1c09d356d6a4eba77e2020-04-11T10:09:20Z2020-04-11T13:23:23ZLaunch scroll program with the default shellQuentin Rameauquinq@fifth.spacecommit c1145268f6b6c6f03a8bec1c09d356d6a4eba77e
parent 0b73612c0dc51dbec1717e5da94bc94559c37246
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 11 Apr 2020 12:09:20 +0200
Launch scroll program with the default shell
0b73612c0dc51dbec1717e5da94bc94559c372462020-04-11T09:52:58Z2020-04-11T13:23:23ZUpdate FAQ with the last modificationsRoberto E. Vargas Caballerok0ga@shike2.comcommit 0b73612c0dc51dbec1717e5da94bc94559c37246
parent 019449a7e64a881be8cc5d715fe9de32726ba190
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 11 Apr 2020 11:52:58 +0200
Update FAQ with the last modifications
019449a7e64a881be8cc5d715fe9de32726ba1902020-04-10T20:50:23Z2020-04-11T13:23:23ZAdd terminfo entries for backspace modeRoberto E. Vargas Caballerok0ga@shike2.comcommit 019449a7e64a881be8cc5d715fe9de32726ba190
parent fbae700a3f32db76106b0ff6f49a73ecf0c2b4fe
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 10 Apr 2020 22:50:23 +0200
Add terminfo entries for backspace mode
St used to use backspace as BS until the commit 230d0c8, but due
to general lack of knowledge of lusers, we moved to the most common
configuration in linux to avoid answering the same question 3 times
per month. With the most common configuration we have a backspace
that returns a DEL, and we have a Delete key that doesn't return a
DEL character neither a BS.
When dealing with devices connected using a serial line (or even
with Plan9) it is more common Backspace as BS and Delete as DEL. For
this reason, st is not always the best tool when you talk with a
serial device.
This patch adds new terminfo entries for Backspace as BS and Delete
as DEL. A patch for confg.h is also added, to make easier switch
between both configurations.
fbae700a3f32db76106b0ff6f49a73ecf0c2b4fe2020-04-10T20:26:12Z2020-04-11T13:23:23ZFix style issueRoberto E. Vargas Caballerok0ga@shike2.comcommit fbae700a3f32db76106b0ff6f49a73ecf0c2b4fe
parent e52319cc7d153e4f59b38c4fb4c0556e118d4775
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 10 Apr 2020 22:26:12 +0200
Fix style issue
e52319cc7d153e4f59b38c4fb4c0556e118d47752020-04-10T20:25:46Z2020-04-11T13:23:23Zttyread: test for EOF while reading ttyRoberto E. Vargas Caballerok0ga@shike2.comcommit e52319cc7d153e4f59b38c4fb4c0556e118d4775
parent 21e0d6e8b8d20903494386e7e6f43201b3761154
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 10 Apr 2020 22:25:46 +0200
ttyread: test for EOF while reading tty
When a read operation returns 0 then it means that we arrived to the end of the
file, and new reads will return 0 unless you do some other operation such as
lseek(). This case happens with USB-232 adapters when they are unplugged.
21e0d6e8b8d20903494386e7e6f43201b37611542020-04-10T20:06:32Z2020-04-11T13:23:20ZAdd support for scroll(1)Roberto E. Vargas Caballerok0ga@shike2.comcommit 21e0d6e8b8d20903494386e7e6f43201b3761154
parent 5703aa0390484dd7da4bd9c388c85708d8fcd339
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 10 Apr 2020 22:06:32 +0200
Add support for scroll(1)
Scroll is a program that stores all the lines of its child and be used in st as
a way of implementing scrollback.
This solution is much better than implementing the scrollback in st itself
because having a different program allows to use it in any other program
without doing modifications to those programs.
5703aa0390484dd7da4bd9c388c85708d8fcd3392020-04-10T10:12:43Z2020-04-10T10:12:43Zmake argv0 not static, fixes a warning with tccHiltjo Posthumahiltjo@codemadness.orgcommit 5703aa0390484dd7da4bd9c388c85708d8fcd339
parent 28ad28839985e965c9ca06a9a202523414c84ac4
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 10 Apr 2020 12:12:43 +0200
make argv0 not static, fixes a warning with tcc
Reported by Aajonus, thanks!
28ad28839985e965c9ca06a9a202523414c84ac42020-04-02T08:43:22Z2020-04-02T12:41:03Zmouseshortcuts: fix custom modifier on releaseAvi Halachmi (:avih)avihpit@yahoo.comcommit 28ad28839985e965c9ca06a9a202523414c84ac4
parent 51e19ea11dd42eefed1ca136ee3f6be975f618b1
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Thu, 2 Apr 2020 11:43:22 +0300
mouseshortcuts: fix custom modifier on release
This line didn't work at mshortcuts at config.h:
/* mask button function arg release */
{ ShiftMask, Button2, selpaste, {.i = 0}, 1 },
and now it does work.
The issue was that XButtonEvent.state is "the logical state ... just prior
to the event", which means that on release the state has the Button2Mask
bit set because button2 was down just before it was released.
The issue didn't manifest with the default shift + middle-click on release
(to override mouse mode) because its specified modifier is XK_ANY_MOD, at
which case match(...) ignores any specific bits and simply returns true.
The issue also doesn't manifest on press, because prior to the event
Button<N> was not down and its mask bit is not set.
Fix by filtering out the mask of the button which we're currently matching.
We could have said "well, that's how button events behave, you should
use ShiftMask|Button2Mask for release", but this both not obvious to
figure out, and specifically here always filtering does not prevent
configuring any useful modifiers combination. So it's a win-win.
51e19ea11dd42eefed1ca136ee3f6be975f618b12020-02-18T15:28:47Z2020-02-18T23:46:20ZRemove explicit XNFocusWindowIvan Thampickfire@riseup.netcommit 51e19ea11dd42eefed1ca136ee3f6be975f618b1
parent 26cdfebf31f024e331429e482b1ee342708888e3
Author: Ivan Tham <pickfire@riseup.net>
Date: Tue, 18 Feb 2020 23:28:47 +0800
Remove explicit XNFocusWindow
XCreateIC ICValues default XNFocusWindow to XNClientWindow if not
specified, it can be omitted since it is the same.
From the documentation
https://www.x.org/releases/current/doc/libX11/libX11/libX11.html
> Focus Window
>
> The XNFocusWindow argument specifies the focus window. The primary
> purpose of the XNFocusWindow is to identify the window that will receive
> the key event when input is composed.
>
> When this XIC value is left unspecified, the input method will use the
> client window as the default focus window.
26cdfebf31f024e331429e482b1ee342708888e32020-02-02T20:47:19Z2020-02-02T21:56:51Zx: fix XIM handlingQuentin Rameauquinq@fifth.spacecommit 26cdfebf31f024e331429e482b1ee342708888e3
parent cd785755f2e3e3305c7d2556a04423a40bce060a
Author: Quentin Rameau <quinq@fifth.space>
Date: Sun, 2 Feb 2020 21:47:19 +0100
x: fix XIM handling
Do not try to set specific IM method, let the user specify it with
XMODIFIERS.
If the requested method is not available or opening fails, fallback to
the default input handler and register a handler on the new IM server
availability signal.
Do the same when the input server is closed and (re)started.
cd785755f2e3e3305c7d2556a04423a40bce060a2020-02-02T16:38:36Z2020-02-02T21:56:51Zx: check we still have an XIC context before accessing itQuentin Rameauquinq@fifth.spacecommit cd785755f2e3e3305c7d2556a04423a40bce060a
parent 2cb539142b97bd2a5c1a322fd7c063c6afb67c9b
Author: Quentin Rameau <quinq@fifth.space>
Date: Sun, 2 Feb 2020 17:38:36 +0100
x: check we still have an XIC context before accessing it
2cb539142b97bd2a5c1a322fd7c063c6afb67c9b2020-02-02T14:38:08Z2020-02-02T21:56:51Zx: do not instantiate a new nested list on each cursor moveQuentin Rameauquinq@fifth.spacecommit 2cb539142b97bd2a5c1a322fd7c063c6afb67c9b
parent 99de33395126fc9708f442d155e737b9182f6ef4
Author: Quentin Rameau <quinq@fifth.space>
Date: Sun, 2 Feb 2020 15:38:08 +0100
x: do not instantiate a new nested list on each cursor move
99de33395126fc9708f442d155e737b9182f6ef42020-02-02T14:37:29Z2020-02-02T21:56:51Zx: move IME variables into XWindow ime embedded structQuentin Rameauquinq@fifth.spacecommit 99de33395126fc9708f442d155e737b9182f6ef4
parent 895e5b50a8cc835c19a45e1e328eb4dc78f5fd0c
Author: Quentin Rameau <quinq@fifth.space>
Date: Sun, 2 Feb 2020 15:37:29 +0100
x: move IME variables into XWindow ime embedded struct
895e5b50a8cc835c19a45e1e328eb4dc78f5fd0c2020-01-18T07:52:25Z2020-01-18T13:21:50ZIncrease XmbLookupString bufferIvan Thampickfire@riseup.netcommit 895e5b50a8cc835c19a45e1e328eb4dc78f5fd0c
parent 384830110bddcebed00b6530a5336f07ad7c405f
Author: Ivan Tham <pickfire@riseup.net>
Date: Sat, 18 Jan 2020 15:52:25 +0800
Increase XmbLookupString buffer
Current buffer is too short to input medium to long sentences from IME.
Input with longer text will show the wrong input, taking 64 instead of
32 bytes should be enough for most of the cases. Broken cases before,
Chinese (taken from song 也可以)
可不可以轻轻的松开自己
Japanese (taken from bootleggers rom quote)
あなたは家のように感じる
384830110bddcebed00b6530a5336f07ad7c405f2019-11-17T19:04:52Z2019-11-17T19:04:52Zupdate FAQHiltjo Posthumahiltjo@codemadness.orgcommit 384830110bddcebed00b6530a5336f07ad7c405f
parent 2e54a21b5ae249a6bcedab9db611ea86037a018b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 17 Nov 2019 20:04:52 +0100
update FAQ
- add common question about the w3m image drawing hack.
- remove some bad advise about $TERM.
- change some links to https.
2e54a21b5ae249a6bcedab9db611ea86037a018b2019-10-16T09:55:53Z2019-11-10T21:45:54ZOSC 52 - copy to clipboard: don't limit to 382 bytesAvi Halachmi (:avih)avihpit@yahoo.comcommit 2e54a21b5ae249a6bcedab9db611ea86037a018b
parent 289c52b7aa9b0e826bbea6f956755b3199b3ccac
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Wed, 16 Oct 2019 12:55:53 +0300
OSC 52 - copy to clipboard: don't limit to 382 bytes
Strings which an application sends to the terminal in OSC, DCS, etc
are typically small (title, colors, etc) but one exception is OSC 52
which copies text to the clipboard, and is used for instance by tmux.
Previously st cropped these strings at 512 bytes, which for OSC 52
limited the copied text to 382 bytes (remaining buffer space before
base64). This made it less useful than it can be.
Now it's a dynamic growing buffer. It remains allocated after use,
resets to 512 when a new string starts, or leaked on exit.
Resetting/deallocating the buffer right after use (at strhandle) is
possible with some more code, however, it doesn't always end up used,
and to cover those cases too will require even more code, so resetting
only on new string is good enough for now.
289c52b7aa9b0e826bbea6f956755b3199b3ccac2019-10-16T09:38:43Z2019-11-10T21:45:54ZCSIEscape, STREscape: use size_t for buffer lengthHiltjo Posthumahiltjo@codemadness.orgcommit 289c52b7aa9b0e826bbea6f956755b3199b3ccac
parent 7ceb3d1f72eabfa678e5cfae176c57630ad98c43
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 16 Oct 2019 12:38:43 +0300
CSIEscape, STREscape: use size_t for buffer length
7ceb3d1f72eabfa678e5cfae176c57630ad98c432019-10-16T09:19:49Z2019-11-10T21:45:54ZSTREscape: don't trim prematurelyAvi Halachmi (:avih)avihpit@yahoo.comcommit 7ceb3d1f72eabfa678e5cfae176c57630ad98c43
parent ea4d933ed9d8ce16699c84892a29e070c70b2eb9
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Wed, 16 Oct 2019 12:19:49 +0300
STREscape: don't trim prematurely
STRescape holds strings in escape sequences such as OSC and DCS, and
its buffer is 512 bytes.
If the input is too big then trailing chars are ignored, but the test
was off-by-1 such that it took 510 chars instead of 511 (before a
terminating NULL is added).
Now the full size can be utilized.
ea4d933ed9d8ce16699c84892a29e070c70b2eb92019-10-16T08:17:23Z2019-11-10T21:45:54Zbase64dec: don't read out of boundsAvi Halachmi (:avih)avihpit@yahoo.comcommit ea4d933ed9d8ce16699c84892a29e070c70b2eb9
parent 83866428de031300eab03fbb116bcf7d2b1d4f60
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Wed, 16 Oct 2019 11:17:23 +0300
base64dec: don't read out of bounds
Previously, base64dec checked terminating input '\0' every 4 calls to
base64dec_getc, where the latter progressed one or more chars on each
call, and could read past '\0' in the way it was used.
The input to base64dec currently comes only from OSC 52 escape seq
(copy to clipboard), and reading past '\0' or even past the buffer
boundary was easy to trigger.
Also, even if we could trust external input to be valid base64, there
are different base64 standards, and not all of them require padding
to 4 bytes blocks (using trailing '=' chars).
It didn't affect short OSC 52 strings because the buffer is initialized
to 0's, so typically it did stop within the buffer, but if the string
was trimmed to fit (the buffer is 512 bytes) then it did also read past
the end of the buffer, and the decoded suffix ended up arbitrary.
This patch makes base64dec_getc not progress past '\0', and instead
produce fake trailing padding of '='.
Additionally, at base64dec, if padding is detected at the first or
second byte of a quartet, then we identify it as invalid and abort
(a valid quartet has at least two leading non-padding bytes).
83866428de031300eab03fbb116bcf7d2b1d4f602019-11-05T17:16:39Z2019-11-05T18:51:35ZFix tmux terminfo extensions Se and SsSebastian J. Bronnerwaschtl@sbronner.comcommit 83866428de031300eab03fbb116bcf7d2b1d4f60
parent 1f09f0b0bbba29ceed9b4e6d558b6ad5b0843cfe
Author: Sebastian J. Bronner <waschtl@sbronner.com>
Date: Tue, 5 Nov 2019 18:16:39 +0100
Fix tmux terminfo extensions Se and Ss
The tmux terminfo extensions Ss and Se are currently specified as
booleans in `st.info`. They should be strings. See
https://github.com/tmux/tmux/blob/eeedb43ae847a0a692ceea965f7556e84bca4fd0/tty-term.c
lines 254 and 265.
I have used the values from
https://invisible-island.net/ncurses/terminfo.src.html#toc-_S_I_M_P_L_E_T_E_R_M
for this patch.
1f09f0b0bbba29ceed9b4e6d558b6ad5b0843cfe2019-05-31T20:25:35Z2019-10-26T09:47:24Zapply hints before initial mapping (ICCCM)Ingo Lohmaringo.lohmar@posteo.netcommit 1f09f0b0bbba29ceed9b4e6d558b6ad5b0843cfe
parent a2c479c4c8d035c11a91e4b954a9f161bf4c7150
Author: Ingo Lohmar <ingo.lohmar@posteo.net>
Date: Fri, 31 May 2019 22:25:35 +0200
apply hints before initial mapping (ICCCM)
For WM_CLASS this is mentioned in the ICCCM docs
https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.5
(third sentence).
When changing the WM_CLASS from the command line, this is necessary for
window managers to pick it up before applying class-based rules.
a2c479c4c8d035c11a91e4b954a9f161bf4c71502019-10-24T12:42:07Z2019-10-24T13:34:25Zmouse shortcuts: allow using forcemousemod (e.g. shift)Avi Halachmi (:avih)avihpit@yahoo.comcommit a2c479c4c8d035c11a91e4b954a9f161bf4c7150
parent d2b75db8d7519a20af8bf09e9c205507f9ff828c
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Thu, 24 Oct 2019 15:42:07 +0300
mouse shortcuts: allow using forcemousemod (e.g. shift)
The recent mouse shurtcuts commits allow customization, but ignore
forcemousemod mask (default: shift) as a modifier, for no good reason
other than following the behavior of the KB shortcuts.
Allow using forcemousemod too, which now can be used to invoke
different shortcuts, though the automatic effect of forcemousemod will
be lost for buttons which use mask with forcemousemod.
E.g. the default is:
static uint forcemousemod = ShiftMask;
...
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
...
where ttysend will be invoked for button4 with any mod when not in mouse
mode, and with shift when in mouse mode.
Now it's possible to do this:
{ ShiftMask, Button4, ttysend, {.s = "foo"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
Which will invoke ttysend("foo") while shift is held and ttysend("\031")
otherwise. Shift still overrides mouse mode, but will now send "foo".
Previously with this setup the second binding was always invoked
because the forceousemod mask was always removed from the event.
Buttons which don't use forcemousemod behave the same as before.
This is useful e.g. for the scrollback mouse patch, which wants to
configure shift+wheel for scrollback, while keeping the normal behavior
without shift.
d2b75db8d7519a20af8bf09e9c205507f9ff828c2019-10-10T23:26:10Z2019-10-13T19:46:31Zmouse shortcuts: don't hardcode selpasteAvi Halachmi (:avih)avihpit@yahoo.comcommit d2b75db8d7519a20af8bf09e9c205507f9ff828c
parent b6d280de6df30167ce9cf30fadefc362e77729e7
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Fri, 11 Oct 2019 02:26:10 +0300
mouse shortcuts: don't hardcode selpaste
Because selpaste is activated on release, a release flag was added to
mouse shortcuts which controls whether activation is on press/release,
and selpaste binding to button2 was moved to config.h .
button1 remains the only hardcoded mouse button - for selection + copy.
b6d280de6df30167ce9cf30fadefc362e77729e72019-10-10T20:42:30Z2019-10-13T19:46:31Zmouse shortcuts: allow override for all shortcutsAvi Halachmi (:avih)avihpit@yahoo.comcommit b6d280de6df30167ce9cf30fadefc362e77729e7
parent ba7f4d69af62d20e13fea78a408095e017410651
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Thu, 10 Oct 2019 23:42:30 +0300
mouse shortcuts: allow override for all shortcuts
Allow forceselmod to override all mouse shortcuts rather than only
selection, and rename it to forcemousemod as it's now more appropriate.
This will affect mouse shortcuts which use mask other than XK_ANY_MOD.
This does not affect the default behavior because the default mouse
shortcuts (wheel) use XK_ANY_MOD, where forceselmod already activated
the override also before this change.
Previously, if a mouse shortcut was configured with a specific mod and
forceselmod was held, then the shortcut did not execute unless the
configured mod included forceselmod.
ba7f4d69af62d20e13fea78a408095e0174106512019-10-10T20:02:26Z2019-10-13T19:46:31Zmouse shortcuts: allow same functions as kb shortcutsAvi Halachmi (:avih)avihpit@yahoo.comcommit ba7f4d69af62d20e13fea78a408095e017410651
parent 2b8333f553c14c15398e810353e192eb05938580
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Thu, 10 Oct 2019 23:02:26 +0300
mouse shortcuts: allow same functions as kb shortcuts
Previously mouse shortcuts supported only ttywrite.
This required adding an "Arg" function ttysend - which does what the
original mouse shortcuts did.
2b8333f553c14c15398e810353e192eb059385802019-08-26T15:58:47Z2019-08-26T15:58:47Zconfig.def.h: remove crlf value sectionHiltjo Posthumahiltjo@codemadness.orgcommit 2b8333f553c14c15398e810353e192eb05938580
parent caa1d8fbea2b92bca24652af0fee874bdbbbb3e5
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 26 Aug 2019 17:58:47 +0200
config.def.h: remove crlf value section
this is not used anymore.
patch sent as an ed script using RFC2549 by k0ga.
caa1d8fbea2b92bca24652af0fee874bdbbbb3e52019-05-17T11:00:10Z2019-05-17T11:00:10ZFAQ: add entry about color emoji Xft bugHiltjo Posthumahiltjo@codemadness.orgcommit caa1d8fbea2b92bca24652af0fee874bdbbbb3e5
parent f1546cf9c1f9fc52d26dbbcf73210901e83c7ecf
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 17 May 2019 13:00:10 +0200
FAQ: add entry about color emoji Xft bug
This has been asked many times on IRC and the mailinglist. Make it easier to
find information about this particular Xft issue by adding it to the FAQ.
f1546cf9c1f9fc52d26dbbcf73210901e83c7ecf2019-04-09T22:54:43Z2019-04-14T11:50:20Zselection: fix view to match actual selection on first cellAvi Halachmi (:avih)avihpit@yahoo.comcommit f1546cf9c1f9fc52d26dbbcf73210901e83c7ecf
parent 21367a040f056f6a207fafa066bd1cb2d9cae586
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Wed, 10 Apr 2019 01:54:43 +0300
selection: fix view to match actual selection on first cell
21367a040f056f6a207fafa066bd1cb2d9cae5862019-03-15T19:40:16Z2019-03-15T19:40:16Zrevert part of commit add0211522737b79dad990ccd65c8af63b5cc1ddHiltjo Posthumahiltjo@codemadness.orgcommit 21367a040f056f6a207fafa066bd1cb2d9cae586
parent b650256044f867851725f712fdac58d4ff294808
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 15 Mar 2019 20:40:16 +0100
revert part of commit add0211522737b79dad990ccd65c8af63b5cc1dd
"use iswspace()/iswpunct() to find word delimiters
this inverts the configuration logic: you no longer provide a list of
delimiters -- all space and punctuation characters are considered
delimiters, unless listed in extrawordchars."
Feedback from IRC and personal preference.
b650256044f867851725f712fdac58d4ff2948082019-03-15T13:44:28Z2019-03-15T13:47:08Zdont print color warning on color reset OSC 104 without parameterHiltjo Posthumahiltjo@codemadness.orgcommit b650256044f867851725f712fdac58d4ff294808
parent 9acec468fbeaa9f90578352b610431ca9b2d4ee4
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 15 Mar 2019 14:44:28 +0100
dont print color warning on color reset OSC 104 without parameter
also print explicitly "(null)" when printf "%s" p=NULL.
noticed when exiting mutt: printf '\x1b]104\x07'
9acec468fbeaa9f90578352b610431ca9b2d4ee42019-03-15T13:42:50Z2019-03-15T13:42:50Zminor code-style, initialize var at the top of functionHiltjo Posthumahiltjo@codemadness.orgcommit 9acec468fbeaa9f90578352b610431ca9b2d4ee4
parent 927621f6da015f51710c03279b00c6cc38057e32
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 15 Mar 2019 14:42:50 +0100
minor code-style, initialize var at the top of function
927621f6da015f51710c03279b00c6cc38057e322019-03-15T11:31:54Z2019-03-15T11:31:54Zconfig.def.h: tweak extra worddelimitersHiltjo Posthumahiltjo@codemadness.orgcommit 927621f6da015f51710c03279b00c6cc38057e32
parent add0211522737b79dad990ccd65c8af63b5cc1dd
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 15 Mar 2019 12:31:54 +0100
config.def.h: tweak extra worddelimiters
This changes the selection more like xterm.
To test try: "find /" and select a path.
add0211522737b79dad990ccd65c8af63b5cc1dd2019-03-13T15:15:04Z2019-03-15T11:25:13Zuse iswspace()/iswpunct() to find word delimitersLauri Tirkkonenlotheac@iki.ficommit add0211522737b79dad990ccd65c8af63b5cc1dd
parent d5efd256aa3840476579a27293ef1fb92a4b51e7
Author: Lauri Tirkkonen <lotheac@iki.fi>
Date: Wed, 13 Mar 2019 17:15:04 +0200
use iswspace()/iswpunct() to find word delimiters
this inverts the configuration logic: you no longer provide a list of
delimiters -- all space and punctuation characters are considered
delimiters, unless listed in extrawordchars.
d5efd256aa3840476579a27293ef1fb92a4b51e72019-03-13T17:40:52Z2019-03-15T11:24:13Zreplace utf8strchr with wcschrLauri Tirkkonenlotheac@iki.ficommit d5efd256aa3840476579a27293ef1fb92a4b51e7
parent 75b4ba4b4be70a3ae429b1719d18b021839216d5
Author: Lauri Tirkkonen <lotheac@iki.fi>
Date: Wed, 13 Mar 2019 19:40:52 +0200
replace utf8strchr with wcschr
75b4ba4b4be70a3ae429b1719d18b021839216d52019-03-13T15:08:50Z2019-03-13T16:51:58Zbe silent about explicitly unhandled mouse modesLauri Tirkkonenlotheac@iki.ficommit 75b4ba4b4be70a3ae429b1719d18b021839216d5
parent ed68fe7dce2b21b4e0e595b99d47790e76812cb7
Author: Lauri Tirkkonen <lotheac@iki.fi>
Date: Wed, 13 Mar 2019 17:08:50 +0200
be silent about explicitly unhandled mouse modes
ed68fe7dce2b21b4e0e595b99d47790e76812cb72019-03-03T10:29:43Z2019-03-03T10:29:43Zsimplify (greedy) font caching allocating a bitHiltjo Posthumahiltjo@codemadness.orgcommit ed68fe7dce2b21b4e0e595b99d47790e76812cb7
parent 4e0135afeca43f5affe13d7269cb98e7ac526074
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 3 Mar 2019 11:29:43 +0100
simplify (greedy) font caching allocating a bit
POSIX says:
"If ptr is a null pointer, realloc() shall be equivalent to malloc() for the
specified size."
4e0135afeca43f5affe13d7269cb98e7ac5260742019-03-03T10:23:54Z2019-03-03T10:23:54Zstyle: remove double empty newlinesHiltjo Posthumahiltjo@codemadness.orgcommit 4e0135afeca43f5affe13d7269cb98e7ac526074
parent a8cb8e94547d7e31441d2444e8a196415e3e4c1f
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 3 Mar 2019 11:23:54 +0100
style: remove double empty newlines
a8cb8e94547d7e31441d2444e8a196415e3e4c1f2019-02-28T01:56:01Z2019-03-03T10:18:31Zfix use after free in font caching algorithmmagrasdr.magras@gmail.comcommit a8cb8e94547d7e31441d2444e8a196415e3e4c1f
parent e85b6b64660214121164ea97fb098eaa4935f7db
Author: magras <dr.magras@gmail.com>
Date: Thu, 28 Feb 2019 04:56:01 +0300
fix use after free in font caching algorithm
Current font caching algorithm contains a use after free error. A font
removed from `frc` might be still listed in `wx.specbuf`. It will lead
to a crash inside `XftDrawGlyphFontSpec()`.
Steps to reproduce:
$ st -f 'Misc Tamsyn:scalable=false'
$ curl https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
Of course, result depends on fonts installed on a system and fontconfig.
In my case, I'm getting consistent segfaults with different fonts.
I replaced a fixed array with a simple unbounded buffer with a constant
growth rate. Cache starts with a capacity of 0, gets increments by 16,
and never shrinks. On my machine after `cat UTF-8-demo.txt` buffer
reaches a capacity of 192. During casual use capacity stays at 0.