st, branch HEAD simple terminal 91c043d124f31f21f7c3e3e3ecfcb87c4c641103 2022-04-26T18:50:18Z 2022-10-08T09:07:21Z Add config.h parazyd parazyd@dyne.org commit 91c043d124f31f21f7c3e3e3ecfcb87c4c641103 parent d7a6be454944e0de0907e03883ee8a0d6e49ed5e Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:50:18 +0200 Add config.h d7a6be454944e0de0907e03883ee8a0d6e49ed5e 2022-04-26T18:50:06Z 2022-10-08T09:07:21Z anysize parazyd parazyd@dyne.org commit d7a6be454944e0de0907e03883ee8a0d6e49ed5e parent cc6999c8b6eaa714222eecd519d8212781190ce7 Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:50:06 +0200 anysize cc6999c8b6eaa714222eecd519d8212781190ce7 2022-04-26T18:48:13Z 2022-10-08T09:07:21Z glyph wide support parazyd parazyd@dyne.org commit cc6999c8b6eaa714222eecd519d8212781190ce7 parent 97988681134630a84c9824d83027d0f429d427e8 Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:48:13 +0200 glyph wide support 97988681134630a84c9824d83027d0f429d427e8 2022-04-26T18:45:45Z 2022-10-08T09:07:20Z plumb selected text with right click parazyd parazyd@dyne.org commit 97988681134630a84c9824d83027d0f429d427e8 parent 953e60e96aca92491703ff1cb6aec33f91c0e945 Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:45:45 +0200 plumb selected text with right click 953e60e96aca92491703ff1cb6aec33f91c0e945 2022-04-26T18:37:09Z 2022-10-08T09:07:20Z spoiler parazyd parazyd@dyne.org commit 953e60e96aca92491703ff1cb6aec33f91c0e945 parent 4764942b579aec913184d9d2c0f9a660b160db7a Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:37:09 +0200 spoiler 4764942b579aec913184d9d2c0f9a660b160db7a 2022-04-26T18:36:17Z 2022-10-08T09:07:20Z alpha parazyd parazyd@dyne.org commit 4764942b579aec913184d9d2c0f9a660b160db7a parent 6cca7457aa2251ce22e0ce49ad1dbf17bbf50ff0 Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:36:17 +0200 alpha 6cca7457aa2251ce22e0ce49ad1dbf17bbf50ff0 2022-04-26T18:30:01Z 2022-10-08T09:07:20Z invert parazyd parazyd@dyne.org commit 6cca7457aa2251ce22e0ce49ad1dbf17bbf50ff0 parent 68d1ad9b54e952e3079356aeab8ab37e44c56c2c Author: parazyd <parazyd@dyne.org> Date: Tue, 26 Apr 2022 20:30:01 +0200 invert 68d1ad9b54e952e3079356aeab8ab37e44c56c2c 2022-10-04T17:40:30Z 2022-10-04T17:40:30Z bump version to 0.9 Hiltjo Posthuma hiltjo@codemadness.org commit 68d1ad9b54e952e3079356aeab8ab37e44c56c2c parent 00085199039ee63acc7b1ecb7e3774a9c3552b2a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 4 Oct 2022 19:40:30 +0200 bump version to 0.9 00085199039ee63acc7b1ecb7e3774a9c3552b2a 2022-09-16T21:07:09Z 2022-09-16T21:07:09Z FAQ: document the color emojis crash issue which affected some systems is fixed Hiltjo Posthuma hiltjo@codemadness.org commit 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 72fd32736a612edec43596c14148322122a5544d 2022-08-18T14:55:19Z 2022-08-18T15:14:10Z st: use `void' to indicate an empty parameter list Tom Schwindl schwindl@posteo.de commit 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 baa9357e96d2478baa52a3301e70ac80a229b726 2022-05-01T16:38:40Z 2022-05-01T16:38:40Z Makefile: add manual path for OpenBSD Hiltjo Posthuma hiltjo@codemadness.org commit baa9357e96d2478baa52a3301e70ac80a229b726 parent 8629d9a1da72cc18568a8f146307b0e939b77ebf Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 1 May 2022 18:38:40 +0200 Makefile: add manual path for OpenBSD 8629d9a1da72cc18568a8f146307b0e939b77ebf 2022-01-07T17:21:04Z 2022-04-19T09:43:37Z code-golfing: cleanup osc color related code NRK nrk@disroot.org commit 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. ef0551932fb162f907b40185d2f48c3b497708ee 2022-03-18T11:03:34Z 2022-03-18T11:20:27Z base64_digits: reduce scope, implicit zero, +1 size NRK nrk@disroot.org commit 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. af3bb68add1c40d19d0dee382009e21b0870a38f 2022-03-18T10:20:54Z 2022-03-18T11:11:27Z avoid potential UB when using isprint() NRK nrk@disroot.org commit 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. 2aefa348baf4b702fdce98eb105bcba175d8283f 2022-03-13T09:44:08Z 2022-03-13T09:45:34Z make underlines and strikethroughs respect `chscale` Zacchary Dempsey-Plante zacc@ztdp.ca commit 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` e823e2308f2a99023032a3966ebb7036a31d305f 2022-02-17T14:00:47Z 2022-02-18T12:03:37Z Delay redrawals on palette changes Santtu Lakkala inz@inz.fi commit 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. 2c5edf28ec851907305d73c6218ce75d39f1767f 2022-01-12T08:44:27Z 2022-01-12T08:44:27Z X10/SGR mouse: use alt as meta key instead of super/windows key Hiltjo Posthuma hiltjo@codemadness.org commit 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 b1d97fec47b0d6633addb848131388ec40154ebc 2022-01-10T16:11:17Z 2022-01-10T16:11:17Z LICENSE: bump year Hiltjo Posthuma hiltjo@codemadness.org commit b1d97fec47b0d6633addb848131388ec40154ebc parent ea7cd7b62fdfa6a1fbd882d1565d557577f2cf32 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 10 Jan 2022 17:11:17 +0100 LICENSE: bump year ea7cd7b62fdfa6a1fbd882d1565d557577f2cf32 2022-01-08T19:40:34Z 2022-01-10T16:04:01Z Fix mousereport robert robertrussell.72001@gmail.com commit 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. 7fb0c0cc681f36be2ad12091ef93a41671f32738 2022-01-07T11:39:57Z 2022-01-07T11:39:57Z bump version to 0.8.5 Hiltjo Posthuma hiltjo@codemadness.org commit 7fb0c0cc681f36be2ad12091ef93a41671f32738 parent 7e1c68f25d9f08687a94eeef8d7f8ffd0d14b911 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 7 Jan 2022 12:39:57 +0100 bump version to 0.8.5 7e1c68f25d9f08687a94eeef8d7f8ffd0d14b911 2022-01-02T11:15:45Z 2022-01-02T11:16:57Z FAQ: fix a typo, patch -> path Hiltjo Posthuma hiltjo@codemadness.org commit 7e1c68f25d9f08687a94eeef8d7f8ffd0d14b911 parent 65f1dc428315ae9d7f362e10c668557c1379e7af Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 2 Jan 2022 12:15:45 +0100 FAQ: fix a typo, patch -> path 65f1dc428315ae9d7f362e10c668557c1379e7af 2021-12-29T17:07:17Z 2021-12-30T17:37:17Z Fix overtyping wide characters. jamin acdimalev@gmail.com commit 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 a0467c802d4f86ed162486e3453dd61181423902 2021-12-27T10:41:42Z 2021-12-27T12:07:11Z Fix null pointer access in strhandle Jochen Sprickerhof git@jochen.sprickerhof.de commit 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. 273db5ceaf392e68c2faf8f7dec14ea2e25e980d 2021-12-26T18:00:41Z 2021-12-26T18:00:41Z follow-up fix for OSC color sequences, return Hiltjo Posthuma hiltjo@codemadness.org commit 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. 8e310303903792c010d03c046ba75f8b18f7d3a7 2021-12-26T17:57:04Z 2021-12-26T17:57:44Z Add support for OSC color sequences Raheman Vaiya r.vaiya@gmail.com commit 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 2f6e597ed871cff91c627850d03152cae5f45779 2021-08-24T11:44:35Z 2021-08-24T11:44:35Z fix possible rare crash when Xutf8TextPropertyToTextList fails Hiltjo Posthuma hiltjo@codemadness.org commit 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! 1d3142da968da7f6f61f1c1708f39ca233eda150 2021-08-23T21:25:05Z 2021-08-24T11:30:11Z fix a problem that the standard streams are unexpectedly closed Koichi Murase myoga.murase@gmail.com commit 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. 2ec571a30c0c3b1a17f6b3631c80d573582f59a1 2021-07-17T22:14:00Z 2021-07-18T09:44:56Z Add 14th bit to XK_SWITCH_MOD bitmask Petar Kapriš petarkapris@firemail.cc commit 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. 4536f46cfff50c66a115755def0155d8e246b02f 2021-03-28T19:16:59Z 2021-05-06T16:21:10Z Mild const-correctness improvements. Markus F.X.J. Oberhumer markus@oberhumer.com commit 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. 9e68fdbcdb06dfa3d23fe3a7a7f7b59e40e1ea2f 2021-03-19T10:54:36Z 2021-03-19T10:58:59Z fix: correctly encode mouse buttons >= 8 in X10 and SGR mode Hiltjo Posthuma hiltjo@codemadness.org commit 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 4ef0cbd8b9371f37f7d02ef37b5378b879e6b8bf 2020-10-18T09:18:03Z 2020-10-18T09:18:03Z remove unused variable from previous patch Hiltjo Posthuma hiltjo@codemadness.org commit 4ef0cbd8b9371f37f7d02ef37b5378b879e6b8bf parent 28b4c822c5c0acec300fdf15c6e3ede9f5e2335d Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 18 Oct 2020 11:18:03 +0200 remove unused variable from previous patch 28b4c822c5c0acec300fdf15c6e3ede9f5e2335d 2020-09-06T05:53:41Z 2020-10-18T09:17:11Z ST: Add WM_ICON_NAME property support John Collis john.collis@alliedtelesis.co.nz commit 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. fa253f077f19b3220c7655b81bd91e52f4367803 2020-06-19T09:27:17Z 2020-06-19T09:27:17Z bump version to 0.8.4 Hiltjo Posthuma hiltjo@codemadness.org commit fa253f077f19b3220c7655b81bd91e52f4367803 parent b27a383a3acc7decf00e6e889fca265430b5d329 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 19 Jun 2020 11:27:17 +0200 bump version to 0.8.4 b27a383a3acc7decf00e6e889fca265430b5d329 2020-06-17T21:47:00Z 2020-06-17T21:49:40Z config.mk: use PKG_CONFIG in commented OpenBSD section Hiltjo Posthuma hiltjo@codemadness.org commit 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 81067c65ea4dd80e8eb34755a4f50a4a8c7df06b 2020-06-17T21:44:34Z 2020-06-17T21:49:40Z LICENSE: bump years Hiltjo Posthuma hiltjo@codemadness.org commit 81067c65ea4dd80e8eb34755a4f50a4a8c7df06b parent f74a9df6e1fc88eebe6d673d888b61fd83cf6fc4 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 17 Jun 2020 23:44:34 +0200 LICENSE: bump years f74a9df6e1fc88eebe6d673d888b61fd83cf6fc4 2020-06-17T20:05:48Z 2020-06-17T21:49:22Z remove sixel stub code Hiltjo Posthuma hiltjo@codemadness.org commit 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. 818ec746f4caae453d09368b101c3e841cf39870 2020-06-17T19:35:39Z 2020-06-17T19:35:39Z fix unicode glitch in DCS strings, patch by Tim Allen Hiltjo Posthuma hiltjo@codemadness.org commit 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. " 9ba7ecf7b15ec2986c6142036706aa353b249ef9 2020-06-01T12:09:46Z 2020-06-01T12:09:46Z FAQ: fix single-buffer patch Hiltjo Posthuma hiltjo@codemadness.org commit 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 a2a704492b9f4d2408d180f7aeeacf4c789a1d67 2020-05-30T19:56:18Z 2020-05-30T20:06:15Z config.def.h: add an option allowwindowops, by default off (secure) Hiltjo Posthuma hiltjo@codemadness.org commit 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' 0f8b40652bca0670f1f0bda069bbc55f8b5e364d 2020-05-30T19:50:54Z 2020-05-30T20:05:17Z FAQ: add some details about the w3m img hack Hiltjo Posthuma hiltjo@codemadness.org commit 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. e6e2c6199f102f1459b53717050eee27832f4f87 2020-05-30T19:39:49Z 2020-05-30T20:05:17Z tiny style fix Hiltjo Posthuma hiltjo@codemadness.org commit e6e2c6199f102f1459b53717050eee27832f4f87 parent 94b8ec002101a5e8f52a342e53431eea71aa0631 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 30 May 2020 21:39:49 +0200 tiny style fix 94b8ec002101a5e8f52a342e53431eea71aa0631 2020-05-30T19:34:57Z 2020-05-30T20:04:28Z Partially add back in "support REP (repeat) escape sequence" Hiltjo Posthuma hiltjo@codemadness.org commit 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. dec6b530a4fddf405c1822b2cac6e2036d3c8b75 2020-05-21T02:24:55Z 2020-05-24T11:45:42Z Call xsetcursor to set win.cursor in main Steve Ward planet36@gmail.com commit 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). 475a0a36cb4fda1da30f014da65988e99b222876 2020-05-16T16:06:42Z 2020-05-16T19:06:13Z Revert "support REP (repeat) escape sequence" Hiltjo Posthuma hiltjo@codemadness.org commit 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). e8392b282c2eaa28725241a9612804fb55113da4 2020-05-14T15:18:07Z 2020-05-16T12:08:10Z support REP (repeat) escape sequence Avi Halachmi (:avih) avihpit@yahoo.com commit 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. f8afebdfa0cc9a57b22c39c47e9b585f69453eb7 2020-05-16T10:42:51Z 2020-05-16T12:07:31Z Add rin terminfo capability Roberto E. Vargas k0ga@shike2.com commit 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). bda9c9ffa645ee5e4b2507474ebfa1c5efb889b2 2020-05-16T09:48:18Z 2020-05-16T10:37:14Z Make shift+wheel behaves as shift+Prev/Next k0ga k0ga@shike2.com commit 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. 045a0fab4f80b57f4a982ae6bc5f33fe21d66111 2020-05-06T11:36:59Z 2020-05-12T13:38:17Z Fix selection: selscroll Jakub Leszczak szatan@gecc.xyz commit 045a0fab4f80b57f4a982ae6bc5f33fe21d66111 parent 9c30066e73f0105c3fccb7582c8172d5117857b3 Author: Jakub Leszczak <szatan@gecc.xyz> Date: Wed, 6 May 2020 13:36:59 +0200 Fix selection: selscroll 9c30066e73f0105c3fccb7582c8172d5117857b3 2020-05-06T11:35:53Z 2020-05-12T13:38:02Z Fix selection: ignore ATTR_WRAP when rectangular selection in getsel Jakub Leszczak szatan@gecc.xyz commit 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 8304d4f0599b1be2226c28c553547070658d4af3 2020-05-06T11:35:06Z 2020-05-12T13:37:59Z Fix selection: selclear in tputc Jakub Leszczak szatan@gecc.xyz commit 8304d4f0599b1be2226c28c553547070658d4af3 parent 914fb825df3bde7abdd7947e54f8bf4d2b55e34e Author: Jakub Leszczak <szatan@gecc.xyz> Date: Wed, 6 May 2020 13:35:06 +0200 Fix selection: selclear in tputc 914fb825df3bde7abdd7947e54f8bf4d2b55e34e 2020-05-09T12:43:31Z 2020-05-09T12:43:31Z code-style: add fallthrough comment Hiltjo Posthuma hiltjo@codemadness.org commit 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. cde480c6939e62771ba3b60ef4eb848031aee9f9 2020-05-09T12:03:14Z 2020-05-09T12:11:25Z optimize column width calculation and utf-8 encode for ASCII Hiltjo Posthuma hiltjo@codemadness.org commit 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. 8211e36d281990a39db1853bcd454ac59e53d521 2020-05-09T11:56:28Z 2020-05-09T12:07:52Z fix for incorrect (partial) written sequences when libc wcwidth() == -1 Hiltjo Posthuma hiltjo@codemadness.org commit 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. 87545c612e8ab6e7cd1ef38e2355d0cb86df79f2 2020-05-09T11:55:34Z 2020-05-09T12:05:04Z tiny code-style and typo-fix in comment Hiltjo Posthuma hiltjo@codemadness.org commit 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 1d590910652519268152eae6b97cf30ace4e90c0 2019-02-26T20:37:49Z 2020-05-09T11:53:50Z auto-sync: draw on idle to avoid flicker/tearing Avi Halachmi (:avih) avihpit@yahoo.com commit 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). d6ea0a1a61853dd892029a7126e7fdb70c371878 2020-04-29T22:10:02Z 2020-04-29T23:21:21Z replace exit(3) by _exit(2) in signal handler sigchld() Jan Klemkow j.klemkow@wemelug.de commit 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. 43a395ae91f7d67ce694e65edeaa7bbc720dd027 2020-04-27T11:56:25Z 2020-04-27T11:56:25Z bump version to 0.8.3 Hiltjo Posthuma hiltjo@codemadness.org commit 43a395ae91f7d67ce694e65edeaa7bbc720dd027 parent 72e3f6c7c05b4d5b56388508bb20a863aec279f5 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 27 Apr 2020 13:56:25 +0200 bump version to 0.8.3 72e3f6c7c05b4d5b56388508bb20a863aec279f5 2020-04-19T17:38:39Z 2020-04-19T17:39:48Z Update XIM cursor position only if changed Ivan Tham pickfire@riseup.net commit 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. 33a9a456644ceb235ea6ce61282f3bdce7a8b547 2020-04-11T13:45:06Z 2020-04-11T13:45:06Z just remove the EOF message Hiltjo Posthuma hiltjo@codemadness.org commit 33a9a456644ceb235ea6ce61282f3bdce7a8b547 parent 771bc401f76b329f78a285ca65355d4b43415172 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 11 Apr 2020 15:45:06 +0200 just remove the EOF message 771bc401f76b329f78a285ca65355d4b43415172 2020-04-11T12:46:17Z 2020-04-11T13:23:23Z Add st-mono terminfo entry Roberto E. Vargas Caballero k0ga@shike2.com commit 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. d66bd405c0d0f29beff89683a04a10297e962cb9 2020-04-11T11:56:31Z 2020-04-11T13:23:23Z config.def.h: add a comment for the scroll variable Hiltjo Posthuma hiltjo@codemadness.org commit 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 e997303502ddd5c26cfc41af0ff5356bffc04359 2020-04-11T11:29:48Z 2020-04-11T13:23:23Z Fix small typos Hiltjo Posthuma hiltjo@codemadness.org commit e997303502ddd5c26cfc41af0ff5356bffc04359 parent c1145268f6b6c6f03a8bec1c09d356d6a4eba77e Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 11 Apr 2020 13:29:48 +0200 Fix small typos c1145268f6b6c6f03a8bec1c09d356d6a4eba77e 2020-04-11T10:09:20Z 2020-04-11T13:23:23Z Launch scroll program with the default shell Quentin Rameau quinq@fifth.space commit 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 0b73612c0dc51dbec1717e5da94bc94559c37246 2020-04-11T09:52:58Z 2020-04-11T13:23:23Z Update FAQ with the last modifications Roberto E. Vargas Caballero k0ga@shike2.com commit 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 019449a7e64a881be8cc5d715fe9de32726ba190 2020-04-10T20:50:23Z 2020-04-11T13:23:23Z Add terminfo entries for backspace mode Roberto E. Vargas Caballero k0ga@shike2.com commit 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. fbae700a3f32db76106b0ff6f49a73ecf0c2b4fe 2020-04-10T20:26:12Z 2020-04-11T13:23:23Z Fix style issue Roberto E. Vargas Caballero k0ga@shike2.com commit fbae700a3f32db76106b0ff6f49a73ecf0c2b4fe parent e52319cc7d153e4f59b38c4fb4c0556e118d4775 Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Fri, 10 Apr 2020 22:26:12 +0200 Fix style issue e52319cc7d153e4f59b38c4fb4c0556e118d4775 2020-04-10T20:25:46Z 2020-04-11T13:23:23Z ttyread: test for EOF while reading tty Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 21e0d6e8b8d20903494386e7e6f43201b3761154 2020-04-10T20:06:32Z 2020-04-11T13:23:20Z Add support for scroll(1) Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 5703aa0390484dd7da4bd9c388c85708d8fcd339 2020-04-10T10:12:43Z 2020-04-10T10:12:43Z make argv0 not static, fixes a warning with tcc Hiltjo Posthuma hiltjo@codemadness.org commit 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! 28ad28839985e965c9ca06a9a202523414c84ac4 2020-04-02T08:43:22Z 2020-04-02T12:41:03Z mouseshortcuts: fix custom modifier on release Avi Halachmi (:avih) avihpit@yahoo.com commit 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. 51e19ea11dd42eefed1ca136ee3f6be975f618b1 2020-02-18T15:28:47Z 2020-02-18T23:46:20Z Remove explicit XNFocusWindow Ivan Tham pickfire@riseup.net commit 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. 26cdfebf31f024e331429e482b1ee342708888e3 2020-02-02T20:47:19Z 2020-02-02T21:56:51Z x: fix XIM handling Quentin Rameau quinq@fifth.space commit 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. cd785755f2e3e3305c7d2556a04423a40bce060a 2020-02-02T16:38:36Z 2020-02-02T21:56:51Z x: check we still have an XIC context before accessing it Quentin Rameau quinq@fifth.space commit 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 2cb539142b97bd2a5c1a322fd7c063c6afb67c9b 2020-02-02T14:38:08Z 2020-02-02T21:56:51Z x: do not instantiate a new nested list on each cursor move Quentin Rameau quinq@fifth.space commit 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 99de33395126fc9708f442d155e737b9182f6ef4 2020-02-02T14:37:29Z 2020-02-02T21:56:51Z x: move IME variables into XWindow ime embedded struct Quentin Rameau quinq@fifth.space commit 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 895e5b50a8cc835c19a45e1e328eb4dc78f5fd0c 2020-01-18T07:52:25Z 2020-01-18T13:21:50Z Increase XmbLookupString buffer Ivan Tham pickfire@riseup.net commit 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) あなたは家のように感じる 384830110bddcebed00b6530a5336f07ad7c405f 2019-11-17T19:04:52Z 2019-11-17T19:04:52Z update FAQ Hiltjo Posthuma hiltjo@codemadness.org commit 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. 2e54a21b5ae249a6bcedab9db611ea86037a018b 2019-10-16T09:55:53Z 2019-11-10T21:45:54Z OSC 52 - copy to clipboard: don't limit to 382 bytes Avi Halachmi (:avih) avihpit@yahoo.com commit 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. 289c52b7aa9b0e826bbea6f956755b3199b3ccac 2019-10-16T09:38:43Z 2019-11-10T21:45:54Z CSIEscape, STREscape: use size_t for buffer length Hiltjo Posthuma hiltjo@codemadness.org commit 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 7ceb3d1f72eabfa678e5cfae176c57630ad98c43 2019-10-16T09:19:49Z 2019-11-10T21:45:54Z STREscape: don't trim prematurely Avi Halachmi (:avih) avihpit@yahoo.com commit 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. ea4d933ed9d8ce16699c84892a29e070c70b2eb9 2019-10-16T08:17:23Z 2019-11-10T21:45:54Z base64dec: don't read out of bounds Avi Halachmi (:avih) avihpit@yahoo.com commit 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). 83866428de031300eab03fbb116bcf7d2b1d4f60 2019-11-05T17:16:39Z 2019-11-05T18:51:35Z Fix tmux terminfo extensions Se and Ss Sebastian J. Bronner waschtl@sbronner.com commit 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. 1f09f0b0bbba29ceed9b4e6d558b6ad5b0843cfe 2019-05-31T20:25:35Z 2019-10-26T09:47:24Z apply hints before initial mapping (ICCCM) Ingo Lohmar ingo.lohmar@posteo.net commit 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. a2c479c4c8d035c11a91e4b954a9f161bf4c7150 2019-10-24T12:42:07Z 2019-10-24T13:34:25Z mouse shortcuts: allow using forcemousemod (e.g. shift) Avi Halachmi (:avih) avihpit@yahoo.com commit 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. d2b75db8d7519a20af8bf09e9c205507f9ff828c 2019-10-10T23:26:10Z 2019-10-13T19:46:31Z mouse shortcuts: don't hardcode selpaste Avi Halachmi (:avih) avihpit@yahoo.com commit 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. b6d280de6df30167ce9cf30fadefc362e77729e7 2019-10-10T20:42:30Z 2019-10-13T19:46:31Z mouse shortcuts: allow override for all shortcuts Avi Halachmi (:avih) avihpit@yahoo.com commit 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. ba7f4d69af62d20e13fea78a408095e017410651 2019-10-10T20:02:26Z 2019-10-13T19:46:31Z mouse shortcuts: allow same functions as kb shortcuts Avi Halachmi (:avih) avihpit@yahoo.com commit 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. 2b8333f553c14c15398e810353e192eb05938580 2019-08-26T15:58:47Z 2019-08-26T15:58:47Z config.def.h: remove crlf value section Hiltjo Posthuma hiltjo@codemadness.org commit 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. caa1d8fbea2b92bca24652af0fee874bdbbbb3e5 2019-05-17T11:00:10Z 2019-05-17T11:00:10Z FAQ: add entry about color emoji Xft bug Hiltjo Posthuma hiltjo@codemadness.org commit 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. f1546cf9c1f9fc52d26dbbcf73210901e83c7ecf 2019-04-09T22:54:43Z 2019-04-14T11:50:20Z selection: fix view to match actual selection on first cell Avi Halachmi (:avih) avihpit@yahoo.com commit 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 21367a040f056f6a207fafa066bd1cb2d9cae586 2019-03-15T19:40:16Z 2019-03-15T19:40:16Z revert part of commit add0211522737b79dad990ccd65c8af63b5cc1dd Hiltjo Posthuma hiltjo@codemadness.org commit 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. b650256044f867851725f712fdac58d4ff294808 2019-03-15T13:44:28Z 2019-03-15T13:47:08Z dont print color warning on color reset OSC 104 without parameter Hiltjo Posthuma hiltjo@codemadness.org commit 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' 9acec468fbeaa9f90578352b610431ca9b2d4ee4 2019-03-15T13:42:50Z 2019-03-15T13:42:50Z minor code-style, initialize var at the top of function Hiltjo Posthuma hiltjo@codemadness.org commit 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 927621f6da015f51710c03279b00c6cc38057e32 2019-03-15T11:31:54Z 2019-03-15T11:31:54Z config.def.h: tweak extra worddelimiters Hiltjo Posthuma hiltjo@codemadness.org commit 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. add0211522737b79dad990ccd65c8af63b5cc1dd 2019-03-13T15:15:04Z 2019-03-15T11:25:13Z use iswspace()/iswpunct() to find word delimiters Lauri Tirkkonen lotheac@iki.fi commit 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. d5efd256aa3840476579a27293ef1fb92a4b51e7 2019-03-13T17:40:52Z 2019-03-15T11:24:13Z replace utf8strchr with wcschr Lauri Tirkkonen lotheac@iki.fi commit d5efd256aa3840476579a27293ef1fb92a4b51e7 parent 75b4ba4b4be70a3ae429b1719d18b021839216d5 Author: Lauri Tirkkonen <lotheac@iki.fi> Date: Wed, 13 Mar 2019 19:40:52 +0200 replace utf8strchr with wcschr 75b4ba4b4be70a3ae429b1719d18b021839216d5 2019-03-13T15:08:50Z 2019-03-13T16:51:58Z be silent about explicitly unhandled mouse modes Lauri Tirkkonen lotheac@iki.fi commit 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 ed68fe7dce2b21b4e0e595b99d47790e76812cb7 2019-03-03T10:29:43Z 2019-03-03T10:29:43Z simplify (greedy) font caching allocating a bit Hiltjo Posthuma hiltjo@codemadness.org commit 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." 4e0135afeca43f5affe13d7269cb98e7ac526074 2019-03-03T10:23:54Z 2019-03-03T10:23:54Z style: remove double empty newlines Hiltjo Posthuma hiltjo@codemadness.org commit 4e0135afeca43f5affe13d7269cb98e7ac526074 parent a8cb8e94547d7e31441d2444e8a196415e3e4c1f Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 3 Mar 2019 11:23:54 +0100 style: remove double empty newlines a8cb8e94547d7e31441d2444e8a196415e3e4c1f 2019-02-28T01:56:01Z 2019-03-03T10:18:31Z fix use after free in font caching algorithm magras dr.magras@gmail.com commit 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.