public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/libtsm] f44: Update to v4.7.1
Date: Fri, 21 Aug 2026 19:00:45 GMT	[thread overview]
Message-ID: <178733884523.1.2078108006069473389.rpms-libtsm-926b1459fa30@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/libtsm
            Branch : f44
            Commit : 926b1459fa3032f3be527d24916d9ed6c54082db
            Author : Jocelyn Falempe <jfalempe@redhat.com>
            Date   : 2026-08-20T20:11:59+02:00
            Stats  : +35/-199 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/libtsm/c/926b1459fa3032f3be527d24916d9ed6c54082db?branch=f44

            Log:
            Update to v4.7.1

* libtsm: fix tsm_screen_attr2_t by @kdj0c in https://github.com/kmscon/libtsm/pull/64
* Fix 3 out of bound reads by @kdj0c in https://github.com/kmscon/libtsm/pull/65
* screen/vte: add cursor style support via DECSCUSR (CSI Ps SP q) by @underscoreevelyn in https://github.com/kmscon/libtsm/pull/58
* Fix backward selection by @kdj0c in https://github.com/kmscon/libtsm/pull/54
* Fix also clear the character value for multi-width character. by @kdj0c in https://github.com/kmscon/libtsm/pull/56
* screen: don't clear cells when resizing by @kdj0c in https://github.com/kmscon/libtsm/pull/61

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>

---
diff --git a/.gitignore b/.gitignore
index 2dd1196..27a52db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
 /libtsm-4.4.3.tar.gz
 /libtsm-4.5.0.tar.gz
 /libtsm-4.6.0.tar.gz
+/libtsm-4.7.1.tar.gz

diff --git a/Fix-backward-selection.patch b/Fix-backward-selection.patch
deleted file mode 100644
index ffcafad..0000000
--- a/Fix-backward-selection.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-From 4e7200a4844c98a99318a7cb21f314b4915b9228 Mon Sep 17 00:00:00 2001
-From: Jocelyn Falempe <jfalempe@redhat.com>
-Date: Wed, 24 Jun 2026 23:28:08 +0200
-Subject: [PATCH] Fix backward selection
-
-When selecting with the mouse in backward direction, the selection takes
-only one char.
-This bug was introduced with the commit:
-e4c7bfd scrollback/selection: refactor scrollback and selection code
-
-So store the first click to its own selection (sel_begin) and then when
-the target change, make sure to correctly order sel_start and sel_end.
----
- src/tsm/libtsm-int.h    |  5 +--
- src/tsm/tsm-screen.c    |  8 +++--
- src/tsm/tsm-selection.c | 75 +++++++++++++++++------------------------
- 3 files changed, 39 insertions(+), 49 deletions(-)
-
-diff --git a/src/tsm/libtsm-int.h b/src/tsm/libtsm-int.h
-index 16b7b88..bc6c381 100644
---- a/src/tsm/libtsm-int.h
-+++ b/src/tsm/libtsm-int.h
-@@ -153,8 +153,9 @@ struct tsm_screen {
- 
- 	/* selection */
- 	bool sel_active;
--	struct selection_pos sel_start;
--	struct selection_pos sel_end;
-+	struct selection_pos sel_begin; /* First cell selected */
-+	struct selection_pos sel_start; /* First cell to copy in terminal order */
-+	struct selection_pos sel_end;   /* Last cell to copy */
- 
- 	/* draw2 interface */
- 	struct tsm_screen_cell *cells;
-diff --git a/src/tsm/tsm-screen.c b/src/tsm/tsm-screen.c
-index 2ed815d..b6fab33 100644
---- a/src/tsm/tsm-screen.c
-+++ b/src/tsm/tsm-screen.c
-@@ -191,6 +191,8 @@ static void clear_selection_on_line(struct tsm_screen *con, struct line *line)
- {
- 	if (!con->sel_active)
- 		return;
-+	if (con->sel_begin.line == line)
-+		con->sel_begin.line = NULL;
- 	if (con->sel_start.line == line)
- 		con->sel_start.line = NULL;
- 	if (con->sel_end.line == line)
-@@ -259,7 +261,7 @@ static void remove_from_sb(struct tsm_screen *con, unsigned int num)
- 
- 		if (con->sb.pos == tmp) {
- 			con->sb.pos_num = con->sb.count;
--			con->sb.pos = NULL;	
-+			con->sb.pos = NULL;
- 		}
- 		/*
- 		 * Copy the cells from the scrollback buffer to the line. scrollback buffer can have a different
-@@ -840,9 +842,11 @@ void tsm_screen_clear_sb(struct tsm_screen *con)
- 	con->age = con->age_cnt;
- 
- 	if (con->sel_active) {
-+		if (con->sel_begin.line && is_in_scrollback(&con->sel_begin))
-+			con->sel_begin.line = NULL;
- 		if (con->sel_start.line && is_in_scrollback(&con->sel_start))
- 			con->sel_start.line = NULL;
--		if (con->sel_end.line && is_in_scrollback(&con->sel_end)) 
-+		if (con->sel_end.line && is_in_scrollback(&con->sel_end))
- 			con->sel_end.line = NULL;
- 	}
- 	shl_dlist_for_each_safe(iter, safe, &con->sb.list) {
-diff --git a/src/tsm/tsm-selection.c b/src/tsm/tsm-selection.c
-index 77168ef..a01b4db 100644
---- a/src/tsm/tsm-selection.c
-+++ b/src/tsm/tsm-selection.c
-@@ -175,55 +175,32 @@ static unsigned int copy_line(struct tsm_screen *con, struct line *line, char *b
- 	return pos - buf;
- }
- 
--static void swap_selections(struct tsm_screen *con)
--{
--	struct selection_pos c;
--
--	c = con->sel_start;
--	con->sel_start = con->sel_end;
--	con->sel_end = c;
--}
--
- /*
-- * Normalize a selection
-- *
-- * Start must always point to the top left and end to the bottom right cell
-+ * Returns true if a is before b in terminal order
-  */
--static void norm_selection(struct tsm_screen *con)
-+static bool selection_is_before(struct tsm_screen *con, struct selection_pos *a, struct selection_pos *b)
- {
- 	int i;
--	struct selection_pos *start, *end;
- 
--	start = &con->sel_start;
--	end = &con->sel_end;
-+	if (a->line == b->line)
-+		return (a->x < b->x);
- 
--	if (start->line == end->line) {
--		if (con->sel_start.x > con->sel_end.x)
--			swap_selections(con);
--		return;
--	}
--
--	if (is_in_scrollback(&con->sel_start) != is_in_scrollback(&con->sel_end)) {
--		if (is_in_scrollback(&con->sel_end))
--			swap_selections(con);
--		return;
--	}
-+	if (is_in_scrollback(a) != is_in_scrollback(b))
-+		return (is_in_scrollback(a));
- 
--	if (is_in_scrollback(&con->sel_start) && is_in_scrollback(&con->sel_end)) {
--		if (con->sel_start.line->sb_id > con->sel_end.line->sb_id)
--			swap_selections(con);
--		return;
--	}
-+	if (is_in_scrollback(a) && is_in_scrollback(b))
-+		return (a->line->sb_id < b->line->sb_id);
- 
--	/* so both are not in scroll back buffer and can't be equal */
-+	/* so both are not in scroll back buffer and are not on the same line */
- 	for (i = 0; i < con->size_y; i++) {
--		if (con->lines[i] == con->sel_end.line) {
--			swap_selections(con);
--			return;
--		}
--		if (con->lines[i] == con->sel_start.line)
--			return;
-+		if (con->lines[i] == b->line)
-+			return false;
-+
-+		if (con->lines[i] == a->line)
-+			return true;
- 	}
-+	// Should not happen
-+	return true;
- }
- 
- SHL_EXPORT
-@@ -239,8 +216,9 @@ void tsm_screen_selection_start(struct tsm_screen *con,
- 	con->age = con->age_cnt;
- 
- 	con->sel_active = true;
--	selection_set(con, &con->sel_start, posx, posy);
--	memcpy(&con->sel_end, &con->sel_start, sizeof(con->sel_end));
-+	selection_set(con, &con->sel_begin, posx, posy);
-+	con->sel_start = con->sel_begin;
-+	con->sel_end = con->sel_begin;
- }
- 
- SHL_EXPORT
-@@ -248,6 +226,8 @@ void tsm_screen_selection_target(struct tsm_screen *con,
- 				 unsigned int posx,
- 				 unsigned int posy)
- {
-+	struct selection_pos target;
-+
- 	if (!con || !con->sel_active || posx >= con->size_x || posy >= con->size_y)
- 		return;
- 
-@@ -255,9 +235,14 @@ void tsm_screen_selection_target(struct tsm_screen *con,
- 	/* TODO: more sophisticated ageing */
- 	con->age = con->age_cnt;
- 
--	selection_set(con, &con->sel_end, posx, posy);
--	/* always normalize the selection */
--	norm_selection(con);
-+	selection_set(con, &target, posx, posy);
-+	if (selection_is_before(con, &con->sel_begin, &target)) {
-+		con->sel_start = con->sel_begin;
-+		con->sel_end = target;
-+	} else {
-+		con->sel_start = target;
-+		con->sel_end = con->sel_begin;
-+	}
- }
- 
- SHL_EXPORT
-@@ -284,7 +269,7 @@ void tsm_screen_selection_word(struct tsm_screen *con,
- static unsigned int get_line_index(struct tsm_screen *con, struct line *line)
- {
- 	unsigned int i = 0;
--	
-+
- 	if (line->sb_id)
- 		return 0;
- 
--- 
-2.54.0
-

diff --git a/libtsm.spec b/libtsm.spec
index edc98ee..562493f 100644
--- a/libtsm.spec
+++ b/libtsm.spec
@@ -1,5 +1,5 @@
 Name:           libtsm
-Version:        4.6.0
+Version:        4.7.1
 Release:        %autorelease
 Summary:        DEC-VT terminal emulator state machine
 License:        MIT AND LGPL-2.1-or-later
@@ -12,7 +12,7 @@ BuildRequires:  xz
 BuildRequires:  pkgconfig(xkbcommon)
 BuildRequires:  pkgconfig(check)
 
-Patch:          Fix-backward-selection.patch
+Patch: vte-don-t-emit-double-escape-for-meta-arrow-keys.patch
 
 %description
 TSM is a state machine for DEC VT100-VT520 compatible terminal

diff --git a/sources b/sources
index 8c9f060..398c297 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (libtsm-4.6.0.tar.gz) = fef62d68a8f4f4a1266872c222a8eacaf527f0687dd03d7fefbf0b061ea8d8024c4f461451b494ad0b5cb83b1f6a29dde9de6c7a080b7a2590385ddd86d84c88
+SHA512 (libtsm-4.7.1.tar.gz) = 3a7d033d7b3d939492d5bbf124f80f7c80f69b21633e6095836e4320ae9c9c1df69b5bbea101a71f932f2fdf0f66126ececfbd6d8f370b5e5c8a2f9b019dcdf5

diff --git a/vte-don-t-emit-double-escape-for-meta-arrow-keys.patch b/vte-don-t-emit-double-escape-for-meta-arrow-keys.patch
new file mode 100644
index 0000000..33cc261
--- /dev/null
+++ b/vte-don-t-emit-double-escape-for-meta-arrow-keys.patch
@@ -0,0 +1,31 @@
+From 5e8005ac67e4a96fc2366bd9e892b6214137c8b7 Mon Sep 17 00:00:00 2001
+From: Perry Fraser <perry@frasers.org>
+Date: Sun, 16 Aug 2026 21:44:30 -0400
+Subject: [PATCH] vte: don't emit double escape for meta+arrow keys
+
+When we write an arrow key escape sequence with meta as a modifier,
+TSM_VTE_FLAG_PREPEND_ESCAPE will get set by tsm_vte_handle_keyboard,
+causing us to write ^[^[[1;3A for meta+up arrow.
+
+Let's just unset that flag since we're always writing an escape
+character when writing a arrow escape code.
+---
+ src/tsm/tsm-vte.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/tsm/tsm-vte.c b/src/tsm/tsm-vte.c
+index 04bbe21..f154782 100644
+--- a/src/tsm/tsm-vte.c
++++ b/src/tsm/tsm-vte.c
+@@ -2821,6 +2821,8 @@ static void vte_write_arrow(struct tsm_vte *vte, char direction, unsigned int mo
+ 	char code_with_modifier[6] = {'\e', '[', '1', ';', '0', 'A'};
+ 	char code[3] = {'\e', '[',  'A'};
+ 
++	vte->flags &= ~TSM_VTE_FLAG_PREPEND_ESCAPE;
++
+ 	int modifier = csi_modifier_from_mask(mods);
+ 	if (modifier) {
+ 		code_with_modifier[4] = modifier;
+-- 
+2.55.0
+

                 reply	other threads:[~2026-08-21 19:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178733884523.1.2078108006069473389.rpms-libtsm-926b1459fa30@fedoraproject.org \
    --to=jfalempe@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox