Commit Graph

239 Commits

Author SHA1 Message Date
bakkeby 835d204593 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

https://git.suckless.org/st/commit/9e68fdbcdb06dfa3d23fe3a7a7f7b59e40e1ea2f.html
2021-05-10 09:22:32 +02:00
bakkeby 0325f7c76b vim-browse: segment fault when applied on top of st-clipboard patch ref. #21 2021-05-09 19:53:25 +02:00
bakkeby e039854635 Adding vim browse patch ref. #21 2021-05-09 17:48:28 +02:00
bakkeby e139d1fd75 Refactoring Makefile and config.mk to make it easier to enable patches such as the ligatures patch and the sixel patch 2021-05-09 15:07:12 +02:00
bakkeby 1a1d492cd8 Adding alpha-focus-highlight patch 2021-05-09 14:40:30 +02:00
bakkeby 56e208e0de Adding sync patch ref. #21 2021-05-09 09:25:22 +02:00
bakkeby 3b88d65645 copyurl: upgrading to support non-ascii URLs ref. #21 2021-05-09 08:08:51 +02:00
bakkeby a5435903d4 Adding universcroll patch ref. #21 2021-05-08 17:49:04 +02:00
bakkeby a1303a8811 Adding delkey patch ref. #21 2021-05-08 16:57:59 +02:00
bakkeby a44ac5937f Adding osc_10_11_12_2 patch ref. #21 2021-05-08 16:50:06 +02:00
bakkeby 8c8bace91c Adding netwmicon patch ref. #21 2021-05-08 14:50:06 +02:00
bakkeby 2876951262 Adding desktop patch ref. #21 2021-05-08 14:24:42 +02:00
bakkeby 79278e3d32 Adding undercurl patch ref. #20 2021-05-08 10:53:46 +02:00
bakkeby ce05a34de1 Adding blinking cursor patch ref. #20 2021-05-08 10:13:20 +02:00
Stein Gunnar Bakkeby 8f79391f16
Merge pull request #19 from loiccoyle/advertise_sixel
Advertise sixel support
2021-05-07 21:09:08 +02:00
Loic Coyle f72e1cd3fb advertise sixel support 2021-05-07 16:52:49 +02:00
bakkeby 0fade9158a xresources reload: minor style changes ref. #16 2021-05-07 09:27:05 +02:00
Stein Gunnar Bakkeby eed2984b7f
Merge pull request #16 from loiccoyle/reload_xresources
Add XRESOURCES_RELOAD_PATCH
2021-05-07 09:12:55 +02:00
Stein Gunnar Bakkeby 8a3cd6e454
Merge pull request #18 from loiccoyle/fix_xresources_relativeborder
XRESOURCES_PATCH with RELATIVEBORDER_PATCH
2021-05-07 09:08:26 +02:00
Loic Coyle dbf9e9475c add RELATIVEBORDER_PATCH check 2021-05-07 00:46:04 +02:00
Loic Coyle 540a923fb9 Add XRESOURCES_RELOAD_PATCH 2021-04-24 00:30:14 +02:00
Stein Gunnar Bakkeby c3ed7be893
Merge pull request #15 from loiccoyle/background_alpha_escape_sequence
Add alpha to background color from escape sequence
2021-04-23 11:29:24 +02:00
Loic Coyle ec513b230a Add alpha to background color from escape sequence 2021-04-22 20:49:05 +02:00
bakkeby 08f137a8a0 Adding workaround for Variable Fonts causing too wide letter spacing 2021-04-21 15:54:41 +02:00
bakkeby dbd1d6ece0 Addressing relativeborder plus ligatures combo conflict 2021-03-29 10:27:10 +02:00
bakkeby 636edb09c2 Addressing relativeborder plus ligatures combo conflict 2021-03-29 10:26:04 +02:00
bakkeby 708cdada96 Unable to make while using scrollback patch ref. #14 2021-03-29 09:13:14 +02:00
bakkeby f31c43015d Adding sixel support ref. #7 2021-03-25 11:10:57 +01:00
bakkeby 884c62a056 Adding dynamic cursor color patch ref. #10 2021-02-26 14:33:03 +01:00
bakkeby 6c42872476 keyboardselect: style changes 2021-02-24 08:52:22 +01:00
Stein Gunnar Bakkeby d7b6b1c1c6
Merge pull request #9 from kiprasmel/fix/patch-keyboardselect_st.c-with-ligatures
fix keyboardselect patch when combined with ligatures patch
2021-02-24 08:44:53 +01:00
Kipras Melnikovas c148334008
fix keyboardselect patch when combined with ligatures patch
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
2021-02-24 00:58:48 +02:00
bakkeby 9c0f91c892 Adding alpha gradient patch 2021-02-15 14:38:06 +01:00
bakkeby 99903c67d9 Adding alpha gradient patch 2021-02-15 14:37:37 +01:00
bakkeby a23971fff1 Adding wide glyphs patch 2020-11-14 16:24:07 +01:00
bakkeby ef994f3e6d Adding monochrome patch and anysize-nobar patch 2020-10-23 10:14:00 +02:00
bakkeby 8faa9f3c93 externalpipe: ensure all of st's children are reaped 2020-08-21 17:28:14 +02:00
bakkeby 315c5cbe9f Re-added visualbell patch 2020-08-09 18:09:43 +02:00
bakkeby c8d69b5d70 Added the single drawable buffer patch as per the FAQ in order to get w3m images to display 2020-06-26 15:01:30 +02:00
bakkeby 93aac7e1a3 bump version to 0.8.4 2020-06-25 12:43:25 +02:00
bakkeby 01e341edd5 config.mk: use PKG_CONFIG in commented OpenBSD section 2020-06-25 12:41:49 +02:00
bakkeby d76e637ded LICENSE: bump years 2020-06-25 12:39:04 +02:00
bakkeby 5a12b0dfa1 remove sixel stub code
Remove stub code that was used for an experiment of adding sixel code to st
from the commit f7398434.
2020-06-25 12:38:19 +02:00
bakkeby a6344d3241 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.
"
2020-06-25 12:32:00 +02:00
bakkeby bca86276e7 Adding w3m patch 2020-06-14 20:04:27 +02:00
bakkeby 2c85b5da91 FAQ: fix single-buffer patch (249ef9)
rebase against master
2020-06-10 21:02:22 +02:00
bakkeby effc2107e4 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'
2020-06-10 20:53:01 +02:00
bakkeby d4c3685944 FAQ: add some details about the w3m img hack
... and an example patch to switch from double-buffering to a single buffer.
2020-06-10 20:50:50 +02:00
bakkeby 1cc8258623 tiny style fix (2f4f87) 2020-06-10 20:48:24 +02:00
bakkeby 47370640e4 Partially add back in "support REP (repeat) escape sequence" (aa0631)
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.
2020-06-10 20:46:50 +02:00