st, branch HEAD simple terminal 6e970474743d57a5d8b054c41fd3bff2bc895742 2025-08-09T12:35:14Z 2025-08-09T12:35:14Z bump version to 0.9.3 Hiltjo Posthuma hiltjo@codemadness.org commit 6e970474743d57a5d8b054c41fd3bff2bc895742 parent 5a4666c19e3956069147aee43a06b326d998366e Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 9 Aug 2025 14:35:14 +0200 bump version to 0.9.3 5a4666c19e3956069147aee43a06b326d998366e 2025-08-09T10:57:30Z 2025-08-09T12:22:28Z add a few comments Hiltjo Posthuma hiltjo@codemadness.org commit 5a4666c19e3956069147aee43a06b326d998366e parent d6c431859c6c0201e0668ed24a9f17cebf0a68f5 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 9 Aug 2025 12:57:30 +0200 add a few comments d6c431859c6c0201e0668ed24a9f17cebf0a68f5 2025-08-08T21:11:59Z 2025-08-09T10:34:01Z Support OSC 110, 111, and 112 for resetting colors Ayman Bagabas ayman.bagabas@gmail.com commit d6c431859c6c0201e0668ed24a9f17cebf0a68f5 parent f114bcedd113017d907aad32031db92c050f4bf3 Author: Ayman Bagabas <ayman.bagabas@gmail.com> Date: Fri, 8 Aug 2025 17:11:59 -0400 Support OSC 110, 111, and 112 for resetting colors This adds support for OSC 110, 111, and 112 escape sequences to reset the foreground, background, and cursor colors in the terminal. The changes include handling these sequences in the `strhandle` function of `st.c`, allowing applications to reset colors to their default values. The OSC sequences originated from Xterm control sequences and are now widely used in terminal applications and supported by many terminal emulators. For applications, this allows them to reset colors to default values without needing to know the colors beforehand. Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com> f114bcedd113017d907aad32031db92c050f4bf3 2025-07-27T05:43:47Z 2025-07-27T18:06:54Z Eat up "CSI 58" sequences sasha sasha.code@posteo.mx commit f114bcedd113017d907aad32031db92c050f4bf3 parent 98610fcd37f655d44586323dc86c1d013c2798ce Author: sasha <sasha.code@posteo.mx> Date: Sun, 27 Jul 2025 05:43:47 +0000 Eat up "CSI 58" sequences This is used in the wild by systemd systemctl for example and st misinterpreted it as "blink", because it didn't know "58", then saw "5" as "blink", and then didn't know "245". This should print "foo" as normal text: printf '\e[58:5:245mfoo\n' printf '\e[58:2:50:100:200mfoo\n' 98610fcd37f655d44586323dc86c1d013c2798ce 2025-01-26T12:40:57Z 2025-01-30T16:50:37Z Do not interpret CSI ? u as DECRC Johannes Altmanninger aclopte@gmail.com commit 98610fcd37f655d44586323dc86c1d013c2798ce parent 6009e6e25bdff9548f085e9ae562b1ca305d3a0b Author: Johannes Altmanninger <aclopte@gmail.com> Date: Sun, 26 Jan 2025 13:40:57 +0100 Do not interpret CSI ? u as DECRC The kitty keyboard protocol docs recommend CSI ? u to query support for that protocol, see https://sw.kovidgoyal.net/kitty/keyboard-protocol/ For better or worse, fish shell uses this query to work around bugs in other terminals triggered by requesting that protocol via CSI = 5 u. Unfortunately, st interprets CSI ? u as DECRC (restore cursor position). reproduce with 'printf "\x1b[?u"; cat'. fish could work around this by switching to the alternate screen before running this query; but that might cause tearing on terminals that don't support Synchronized Output. I'm not sure. In the meantime, let's correct our parser. This adds a redundant else-after-return, for consistency with the surrounding code. 6009e6e25bdff9548f085e9ae562b1ca305d3a0b 2024-11-25T11:31:56Z 2024-12-06T12:42:50Z Clear screen: Fix edge case Markus Rinne markus.ka.rinne@gmail.com commit 6009e6e25bdff9548f085e9ae562b1ca305d3a0b parent a0274bc20e11d8672bb2953fdd1d3010c0e708c5 Author: Markus Rinne <markus.ka.rinne@gmail.com> Date: Mon, 25 Nov 2024 13:31:56 +0200 Clear screen: Fix edge case With sequence \e[1J, if cursor is on second line, clear the first line. a0274bc20e11d8672bb2953fdd1d3010c0e708c5 2024-08-09T11:33:47Z 2024-08-09T11:34:56Z fix BadMatch error when embedding on some windows Lucas de Sena lucas@seninha.org commit a0274bc20e11d8672bb2953fdd1d3010c0e708c5 parent 5dbcca49263be094fc38159c297458ae323ef647 Author: Lucas de Sena <lucas@seninha.org> Date: Fri, 9 Aug 2024 13:33:47 +0200 fix BadMatch error when embedding on some windows When embedded, st fails with BadMatch error if the embedder's window has non-default colormap/depth/visual. This commit fixes that by creating st's window inside root and then reparent it into embedder. The reference window for dc.gc is also changed to match root's visuals. A similar commit had been made for dmenu[1]. See this issue[2] on github for context. [1]: https://git.suckless.org/dmenu/commit/0fe460dbd469a1d5b6a7140d0e1801935e4a923b.html [2]: https://github.com/phillbush/xfiles/issues/47 5dbcca49263be094fc38159c297458ae323ef647 2024-05-01T18:45:39Z 2024-05-01T18:45:39Z support colons in SGR character attributes Hiltjo Posthuma hiltjo@codemadness.org commit 5dbcca49263be094fc38159c297458ae323ef647 parent d63b9eb90245926b531bd54b1d591adb96613e70 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 1 May 2024 20:45:39 +0200 support colons in SGR character attributes Patch by Mikhail Kot <to@myrrc.dev> With some modifications to behave more like xterm (see note below). Example: printf '\033[48;2;255:0:0mtest\n' https://invisible-island.net/xterm/ctlseqs/ctlseqs.html Some notes: "CSI Pm m Character Attributes (SGR). [...] o xterm allows either colons (standard) or semicolons (legacy) to separate the subparameters (but after the first colon, colons must be used). d63b9eb90245926b531bd54b1d591adb96613e70 2024-04-05T10:18:41Z 2024-04-05T10:18:41Z bump version to 0.9.2 Hiltjo Posthuma hiltjo@codemadness.org commit d63b9eb90245926b531bd54b1d591adb96613e70 parent 497a75638291454875ba1ec8d484c7f3d6f41d66 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 5 Apr 2024 12:18:41 +0200 bump version to 0.9.2 497a75638291454875ba1ec8d484c7f3d6f41d66 2024-04-03T17:48:11Z 2024-04-03T17:49:05Z Reset title when an empty title string is given DOGMAN dogman@aaathats3as.com commit 497a75638291454875ba1ec8d484c7f3d6f41d66 parent 8c68ec52419f3f965164cafcf589b87e8961348d Author: DOGMAN <dogman@aaathats3as.com> Date: Wed, 3 Apr 2024 19:48:11 +0200 Reset title when an empty title string is given With this patch, st will reset its window title when an empty string is given as the terminal title. For example: printf "\033]0;\007" Some applications, like termdown, expect this functionality. xterm implements it, but it seems that most other terminal emulators don't. In any case, I don't see why there should ever be a case where the st window doesn't have a title property. 8c68ec52419f3f965164cafcf589b87e8961348d 2024-03-30T11:30:49Z 2024-03-30T11:37:06Z Revert "Fix cursor move with wide glyphs" Hiltjo Posthuma hiltjo@codemadness.org commit 8c68ec52419f3f965164cafcf589b87e8961348d parent 5ce971628106fb767ef91bf4386227423f5fdf98 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 30 Mar 2024 12:30:49 +0100 Revert "Fix cursor move with wide glyphs" This reverts commit 7473a8d1a57e5f9aba41b953f4e498c35e1c9dc5. This patch needs some more work. It caused regressions with programs that use GNU readline, etc. Original test-case example from Tim Culverhouse <tim@timculverhouse.com>: printf " 😀" && sleep 2 && printf "\e[D" && sleep 2 && printf "\e[D" && sleep 2 After the patch it caused regressions, example test-case: printf "A字\bB\n" 5ce971628106fb767ef91bf4386227423f5fdf98 2024-03-19T11:13:42Z 2024-03-19T11:13:42Z bump version to 0.9.1 Hiltjo Posthuma hiltjo@codemadness.org commit 5ce971628106fb767ef91bf4386227423f5fdf98 parent f20e169a20f3ee761f7e09714f1d4c10916cf4c6 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 19 Mar 2024 12:13:42 +0100 bump version to 0.9.1 f20e169a20f3ee761f7e09714f1d4c10916cf4c6 2024-03-17T13:42:44Z 2024-03-17T13:42:44Z config.def.h: improve latency for the default configuration Hiltjo Posthuma hiltjo@codemadness.org commit f20e169a20f3ee761f7e09714f1d4c10916cf4c6 parent 95f22c53059ccd60ee701ccf2659dacd95e4e89a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 17 Mar 2024 14:42:44 +0100 config.def.h: improve latency for the default configuration 95f22c53059ccd60ee701ccf2659dacd95e4e89a 2024-03-04T10:56:30Z 2024-03-04T22:50:58Z set upper limit for REP escape sequence argument Tommi Hirvola tommi@hirvola.fi commit 95f22c53059ccd60ee701ccf2659dacd95e4e89a parent 7473a8d1a57e5f9aba41b953f4e498c35e1c9dc5 Author: Tommi Hirvola <tommi@hirvola.fi> Date: Mon, 4 Mar 2024 12:56:30 +0200 set upper limit for REP escape sequence argument Previously, printf 'L\033[2147483647b' would call tputc('L') 2^31 times, making st unresponsive. This commit allows repeating the last character at most 65535 times in order to prevent freezing and DoS attacks. 7473a8d1a57e5f9aba41b953f4e498c35e1c9dc5 2024-02-25T00:31:31Z 2024-02-25T10:56:43Z Fix cursor move with wide glyphs Quentin Rameau quinq@fifth.space commit 7473a8d1a57e5f9aba41b953f4e498c35e1c9dc5 parent a3f7420310be0fd778ef9fe2abf20edc2d8dc81a Author: Quentin Rameau <quinq@fifth.space> Date: Sun, 25 Feb 2024 01:31:31 +0100 Fix cursor move with wide glyphs st would always move back 1 column, even with wide glyhps (using more than a single column). The glyph rune is set on its first column, and the other ones are to 0, so loop until we detect the start of the previous glyph. a3f7420310be0fd778ef9fe2abf20edc2d8dc81a 2024-02-18T12:56:49Z 2024-02-18T15:14:26Z csi: check for private marker in 'S' case Tim Culverhouse tim@timculverhouse.com commit a3f7420310be0fd778ef9fe2abf20edc2d8dc81a parent 9846a56bd7fdc86bf788db04bbbcbde7b7eb9952 Author: Tim Culverhouse <tim@timculverhouse.com> Date: Sun, 18 Feb 2024 06:56:49 -0600 csi: check for private marker in 'S' case The handler for 'S' final character does not check for a private marker. This can cause a conflict with a sequence called 'XTSMGRAPHICS' which also has an 'S' final character, but uses the private marker '?'. Without checking for a private marker, st will perform a scroll up operation when XTSMGRAPHICS is seen, which can cause unexpected display artifacts. 9846a56bd7fdc86bf788db04bbbcbde7b7eb9952 2023-10-07T05:41:02Z 2023-10-07T10:16:59Z Add terminfo entries for bracketed paste mode Peter Hofmann scm@uninformativ.de commit 9846a56bd7fdc86bf788db04bbbcbde7b7eb9952 parent 559fdc278681c98470749adb59f01cd071720458 Author: Peter Hofmann <scm@uninformativ.de> Date: Sat, 7 Oct 2023 07:41:02 +0200 Add terminfo entries for bracketed paste mode Helps Vim (and hopefully others) to discover that this feature exists without further user configuration. 559fdc278681c98470749adb59f01cd071720458 2023-10-07T05:40:45Z 2023-10-07T10:16:59Z Unhide cursor on RIS (\033c) Peter Hofmann scm@uninformativ.de commit 559fdc278681c98470749adb59f01cd071720458 parent 8abe4bcb41aa7fda0ae00823f6a20271124150db Author: Peter Hofmann <scm@uninformativ.de> Date: Sat, 7 Oct 2023 07:40:45 +0200 Unhide cursor on RIS (\033c) It is unclear if it's "required" to do this on RIS, but it's useful when calling reset(1) after interactive programs have crashed and garbled up the screen. FWIW, other terminals do it as well (tested with XTerm, VTE, Kitty, Alacritty, Linux VT). 8abe4bcb41aa7fda0ae00823f6a20271124150db 2023-10-07T05:40:39Z 2023-10-07T10:16:59Z Fix wide glyphs breaking "nowrap" mode Peter Hofmann scm@uninformativ.de commit 8abe4bcb41aa7fda0ae00823f6a20271124150db parent 2fc7e532b23e2f820c6b73d352ec7c41fefa45b5 Author: Peter Hofmann <scm@uninformativ.de> Date: Sat, 7 Oct 2023 07:40:39 +0200 Fix wide glyphs breaking "nowrap" mode Consider the following example: printf '\e[?7l';\ for i in $(seq $(($(tput cols) - 1))); do printf a; done;\ printf '🙈\n';\ printf '\e[?7h' Even though MODE_WRAP has been disabled, the emoji appeared on the next line. This patch keeps wide glyphs on the same line and moves them to the right-most possible position. 2fc7e532b23e2f820c6b73d352ec7c41fefa45b5 2023-10-07T05:40:07Z 2023-10-07T10:16:59Z Don't scroll selection on the other screen Peter Hofmann scm@uninformativ.de commit 2fc7e532b23e2f820c6b73d352ec7c41fefa45b5 parent a6bbc0c96b0a1db804061b0db79101c6b26aec57 Author: Peter Hofmann <scm@uninformativ.de> Date: Sat, 7 Oct 2023 07:40:07 +0200 Don't scroll selection on the other screen Fixes garbage selections when switching to/from the alternate screen. How to reproduce: - Be in primary screen. - Select something. - Run this (switches to alternate screen, positions the cursor at the bottom, triggers selscroll(), and then goes back to primary screen): tput smcup; tput cup $(tput lines) 0; echo foo; tput rmcup - Notice how the (visual) selection now covers a different line. The reason is that selscroll() calls selnormalize() and that cannot find the original range anymore. It's all empty lines now, so it snaps to "select the whole line". a6bbc0c96b0a1db804061b0db79101c6b26aec57 2023-10-07T05:39:00Z 2023-10-07T10:16:59Z Fix bounds checks of dc.col Peter Hofmann scm@uninformativ.de commit a6bbc0c96b0a1db804061b0db79101c6b26aec57 parent eb3b894f4076f2b25afc644a1f444b5cbd96aae8 Author: Peter Hofmann <scm@uninformativ.de> Date: Sat, 7 Oct 2023 07:39:00 +0200 Fix bounds checks of dc.col dc.collen is the length of dc.col, not the maximum index, hence if x is equal to dc.collen, then it's an error. With config.def.h, the last valid index is 259, so this correctly reports "black": $ printf '\033]4;259;?\e\\' 260 is an invalid index and this reports garbage instead of printing an error: $ printf '\033]4;260;?\e\\' eb3b894f4076f2b25afc644a1f444b5cbd96aae8 2023-09-22T13:16:52Z 2023-09-22T13:16:52Z Makefile: remove the options target Hiltjo Posthuma hiltjo@codemadness.org commit eb3b894f4076f2b25afc644a1f444b5cbd96aae8 parent 3a6d6d740110e6ee1b092d05ad746244eedabe4b Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 22 Sep 2023 15:16:52 +0200 Makefile: remove the options target The Makefile used to suppress output (by using @), so this target made sense at the time. But the Makefile should be simple and make debugging with less abstractions or fancy printing. The Makefile was made verbose and doesn't hide the build output, so remove this target. Prompted by a question on the mailing list about the options target. 3a6d6d740110e6ee1b092d05ad746244eedabe4b 2023-06-25T05:38:33Z 2023-06-25T09:59:06Z Fix for wide character being incorrectly cleared on MODE_INSERT Shi Tian shitian@cock.li commit 3a6d6d740110e6ee1b092d05ad746244eedabe4b parent 211964d56ee00a7d46e251cbc150afb79138ae37 Author: Shi Tian <shitian@cock.li> Date: Sun, 25 Jun 2023 05:38:33 +0000 Fix for wide character being incorrectly cleared on MODE_INSERT Under insert mode, when inserting a normal character in front of a wide character, the affected region is shifted to the right by one cell. However, the empty cell is reset as if being a part of a wide character, causing the following cell being mishandled as a dummy cell. To reproduce the bug: printf '\033[4h' # set MODE_INSERT printf 妳好 printf '\033[4D' printf 'x' printf '\033[4l\n' 211964d56ee00a7d46e251cbc150afb79138ae37 2023-02-07T19:00:59Z 2023-02-07T19:00:59Z ignore C1 control characters in UTF-8 mode Hiltjo Posthuma hiltjo@codemadness.org commit 211964d56ee00a7d46e251cbc150afb79138ae37 parent f17abd25b376c292f783062ecf821453eaa9cc4c Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 7 Feb 2023 20:00:59 +0100 ignore C1 control characters in UTF-8 mode Ignore processing and printing C1 control characters in UTF-8 mode. These are in the range: 0x80 - 0x9f. By default in st the mode is set to UTF-8. This matches more the behaviour of xterm with the options -u8 or +u8 also. Also see the xterm resource "allowC1Printable". Let me know if this breaks something, in most cases I don't think so. As usual a very good reference is: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html f17abd25b376c292f783062ecf821453eaa9cc4c 2023-02-07T18:54:29Z 2023-02-07T18:57:34Z Add support for DSR response "OK" escape sequence Adam Price komidore64@gmail.com commit f17abd25b376c292f783062ecf821453eaa9cc4c parent 7e8050cc621f27002eaf1be8114dee2497beff91 Author: Adam Price <komidore64@gmail.com> Date: Tue, 7 Feb 2023 19:54:29 +0100 Add support for DSR response "OK" escape sequence "VT100 defines an escape sequence [1] called Device Status Report (DSR). When the DSR sequence received is `csi 5n`, an "OK" response `csi 0n` is returned. This patch adds that "OK" response. I encountered this missing sequence when I noticed that fzf [2] would clobber my prompt whenever completing a find. To test that ST doesn't currently respond to `csi 5n`, use fzf's shell extension in ST's repo to complete the path for a file. my-fancy-prompt $ vim **<tab> <select a file> st.c Select a file with <enter>, and notice that fzf clobbers some or all of your prompt. After applying this patch, do the same test as above and notice that fzf has no longer clobbered your prompt by placing the file name in the correct position in your command. my-fancy-prompt $ vim **<tab> <select a file> my-fancy prompt $ vim st.c Thank you for considering my first patch submission. [1] https://www.xfree86.org/current/ctlseqs.html#VT100%20Mode [2] https://github.com/junegunn/fzf " Patch slightly adapted with input from the mailinglist, 7e8050cc621f27002eaf1be8114dee2497beff91 2023-02-05T12:29:35Z 2023-02-05T12:29:35Z Fixed OSC color reset without parameter->resets all colors Hiltjo Posthuma hiltjo@codemadness.org commit 7e8050cc621f27002eaf1be8114dee2497beff91 parent e5e959835b195c023d1f685ef4dbbcfc3b5120b2 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 5 Feb 2023 13:29:35 +0100 Fixed OSC color reset without parameter->resets all colors Adapted from (garbled) patch by wim <wim@thinkerwim.org> Additional notes: it should reset all the colors using xloadcols(). To reproduce: set a different (theme) color using some escape code, then reset it: printf '\x1b]104\x07' e5e959835b195c023d1f685ef4dbbcfc3b5120b2 2022-10-25T15:11:11Z 2022-10-25T15:11:11Z fix buffer overflow when handling long composed input Hiltjo Posthuma hiltjo@codemadness.org commit e5e959835b195c023d1f685ef4dbbcfc3b5120b2 parent 68d1ad9b54e952e3079356aeab8ab37e44c56c2c Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 25 Oct 2022 17:11:11 +0200 fix buffer overflow when handling long composed input To reproduce the issue: " If you already have the multi-key enabled on your system, then add this line to your ~/.XCompose file: [...] <question> <T> <E> <S> <T> <question> : "1234567890123456789012345678901234567890123456789012345678901234567890" " Reported by and an initial patch by Andy Gozas <andy@gozas.me>, thanks! Adapted the patch, for now st (like dmenu) handles a fixed amount of composed characters, or otherwise ignores it. This is done for simplicity sake. 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.