Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libtsm for openSUSE:Factory checked in at 2026-01-26 11:33:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libtsm (Old) and /work/SRC/openSUSE:Factory/.libtsm.new.1928 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libtsm" Mon Jan 26 11:33:59 2026 rev:6 rq:1329249 version:4.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libtsm/libtsm.changes 2026-01-08 15:27:18.772770123 +0100 +++ /work/SRC/openSUSE:Factory/.libtsm.new.1928/libtsm.changes 2026-01-26 11:34:08.989912570 +0100 @@ -1,0 +2,15 @@ +Fri Jan 23 12:38:03 UTC 2026 - Fabian Vogt <[email protected]> + +- Update to 4.4.1: + * tsm_vte_paste: check input + * Add support to CSI b sequence (repeat last char) +- Update to 4.4.0: + * Add support for CSI 18t command + * Fix SGR and PIXEL mouse modes blocked by mouse_event check + * Update readme to build without unit tests + * Fix compilation issue on ppc64el + * Fix mouse drag tracking in SGR and PIXEL modes + * Fix tsm_screen_resize() + * vte: Add bracketed paste support (DEC 2004) + +------------------------------------------------------------------- Old: ---- v4.3.0.tar.gz New: ---- v4.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libtsm.spec ++++++ --- /var/tmp/diff_new_pack.3vXM9p/_old 2026-01-26 11:34:11.005996938 +0100 +++ /var/tmp/diff_new_pack.3vXM9p/_new 2026-01-26 11:34:11.033998109 +0100 @@ -1,7 +1,7 @@ # # spec file for package libtsm # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global sover 4 %global lname libtsm%{sover} Name: libtsm -Version: 4.3.0 +Version: 4.4.1 Release: 0 Summary: DEC-VT terminal emulator state machine License: LGPL-2.1-or-later AND MIT @@ -80,7 +80,7 @@ %{_libdir}/libtsm.so.%{sover}* %files devel -%doc README +%doc README.md %{_includedir}/libtsm.h %{_libdir}/libtsm.so %{_libdir}/pkgconfig/*.pc ++++++ v4.3.0.tar.gz -> v4.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/NEWS.md new/libtsm-4.4.1/NEWS.md --- old/libtsm-4.3.0/NEWS.md 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/NEWS.md 2026-01-22 10:17:48.000000000 +0100 @@ -1,5 +1,23 @@ # libtsm Release News +## CHANGES WITH 4.4.1 +### New features +* Add support to CSI b sequence (repeat last char) by @kdj0c in https://github.com/kmscon/libtsm/pull/15 +### Bug fixes +* tsm_vte_paste: check input by @kdj0c in https://github.com/kmscon/libtsm/pull/16 + +## CHANGES WITH 4.4.0: +### New features +* Add support for CSI 18t and 19t command +* Add bracketed paste support (DEC 2004) + +### Bug fixes + * Moved back to https://github.com/kmscon/libtsm + * Fix SGR and PIXEL mouse modes blocked by mouse_event check + * Fix SGR mouse drag tracking in modes 1002 and 1003 + * Fix PIXEL mode drag tracking: remove hardcoded reply_flags + * Fix ppc64el build error + ## CHANGES WITH 4.3.0: ### New features * Add OSC 4, 10 and 11 support (only read color, not set it) https://github.com/Aetf/libtsm/pull/55 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/README new/libtsm-4.4.1/README --- old/libtsm-4.3.0/README 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -= TSM - Terminal Emulator State Machine = - -TSM is a state machine for DEC VT100-VT520 compatible terminal emulators. It -tries to support all common standards while keeping compatibility to existing -emulators like xterm, gnome-terminal, konsole, .. - -TSM itself does not provide any rendering nor window management. It is a simple -plain state machine without any external dependencies. It can be used to -implement terminal emulators, but also to implement other applications that need -to interpret terminal escape sequences. - -This library is very similar to libvte of the gnome project. However, libvte is -highly bound to GTK+, which makes it unsuitable for non-graphics projects that -need to parse escape sequences. Instead, TSM tries to restrict its API to -terminal emulation only. Furthermore, TSM does not try to establish a new -terminal emulation standard, but instead keeps compatibility as close to xterm -as possible. This is why the TERM variable can be set to xterm-color256 with any -TSM based terminal emulator. - -Website: - http://www.freedesktop.org/wiki/Software/libtsm - -== Requirements == - - libtsm has no runtime requirements other than a ISO-C compatible C library. - For keyboard key-symbols, the headers of libxkbcommon are needed during - compile-time only. libtsm ships a copy of these headers if they are not - available at compile-time. - -== Download == - -Released tarballs can be found at: - http://www.freedesktop.org/software/kmscon/releases - -== Install == - - To compile libtsm, run the standard autotools commands: - $ test -f ./configure || NOCONFIGURE=1 ./autogen.sh - $ ./configure - $ make - $ make install - To compile the test applications, run: - $ make check - -== Documentation == - - There is currently no API documentation available. You can have a look at the - example terminal-emulator "wlterm" available at: - http://www.freedesktop.org/wiki/Software/kmscon/wlterm - -== License == - - This software is licensed under the terms of an MIT-like license. Please see - ./COPYING for further information. - -== Contact == - - This software is maintained by: - David Herrmann <[email protected]> - If you have any questions, do not hesitate to contact one of the maintainers. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/README.md new/libtsm-4.4.1/README.md --- old/libtsm-4.3.0/README.md 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/README.md 2026-01-22 10:17:48.000000000 +0100 @@ -1,32 +1,37 @@ # TSM - Terminal Emulator State Machine - + TSM is a state machine for DEC VT100-VT520 compatible terminal emulators. It tries to support all common standards while keeping compatibility to existing -emulators like xterm, gnome-terminal, konsole, ... +emulators like xterm, gnome-terminal, konsole, .. -This is a personal modified version. For more information, please refer to its original [README](README). +TSM itself does not provide any rendering nor window management. It is a simple +plain state machine without any external dependencies. It can be used to +implement terminal emulators, but also to implement other applications that need +to interpret terminal escape sequences. + +This library is very similar to libvte of the gnome project. However, libvte is +highly bound to GTK+, which makes it unsuitable for non-graphics projects that +need to parse escape sequences. Instead, TSM tries to restrict its API to +terminal emulation only. Furthermore, TSM does not try to establish a new +terminal emulation standard, but instead keeps compatibility as close to xterm +as possible. This is why the TERM variable can be set to xterm-color256 with any +TSM based terminal emulator. + +## Requirements + +libtsm has no runtime requirements other than a ISO-C compatible C library. +For keyboard key-symbols, the headers of libxkbcommon are needed during +compile-time only. libtsm ships a copy of these headers if they are not +available at compile-time. -## Added feature -+ More color palettes: - * soft-black - * [base16](https://github.com/chriskempson/base16-default-schemes){-light,-dark} - * solarized{,-black,-white} - * custom: set via API -+ Support underline/italic rendering (with [a patched version of kmscon](https://github.com/Aetf/kmscon)) -+ Support 24-bit true color -+ Support Ctrl + Arrow keys -+ Support custom title using OSC -+ Bug fixes: - * [Response to 'CSI c' contains random bytes][91335] - * [Fix invalid cpr values](https://github.com/Aetf/libtsm/pull/2) +## Download +Releases are available at https://github.com/kmscon/libtsm/releases -[91335]: https://bugs.freedesktop.org/show_bug.cgi?id=91335 - -## Build +## Build and install ```bash -meson setup build +meson setup -Dtests=false build cd build meson compile meson install @@ -35,7 +40,7 @@ ### Build options Options may be supplied when configuring meson: ```bash -meson -Dtests=true -Dextra_debug=true -Dgtktsm=true +meson setup -Dtests=true -Dextra_debug=true -Dgtktsm=true build ``` The following options are available: @@ -43,7 +48,7 @@ |:---:|:---|:---:| | tests | Whether build the test suite | ON | | extra_debug | Whether to enable several non-standard debug options | OFF | -| gtktsm | Whether to build the gtktsm example. This is linux-only as it uses epoll and friends. Therefore is disabled by default. | OFF | +| gtktsm | Whether to build the gtktsm example. This is linux-only as it uses epoll and friends. Therefore, is disabled by default. | OFF | ## Dependencies ### Required @@ -57,3 +62,18 @@ - cairo - pango - xkbcommon + +## Documentation +There is currently no API documentation available. You can have a look at the +example terminal-emulator gtkterm [gtktsm-terminal.c](src/gtktsm/gtktsm-terminal.c) + +## License +This software is licensed under the terms of an MIT-like license. Please see +[COPYING] for further information. + +## Contact +This software is maintained by: + * David Rheinsberg <[email protected]> + * Jocelyn Falempe <[email protected]> + +If you have any questions, do not hesitate to contact one of the maintainers. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/meson.build new/libtsm-4.4.1/meson.build --- old/libtsm-4.3.0/meson.build 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/meson.build 2026-01-22 10:17:48.000000000 +0100 @@ -3,7 +3,7 @@ project( 'libtsm', 'c', - version: '4.3.0', + version: '4.4.1', license: 'MIT', meson_version: '>=1.1', default_options: [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/src/tsm/libtsm-int.h new/libtsm-4.4.1/src/tsm/libtsm-int.h --- old/libtsm-4.3.0/src/tsm/libtsm-int.h 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/src/tsm/libtsm-int.h 2026-01-22 10:17:48.000000000 +0100 @@ -162,6 +162,7 @@ void tsm_screen_set_opts(struct tsm_screen *scr, unsigned int opts); void tsm_screen_reset_opts(struct tsm_screen *scr, unsigned int opts); unsigned int tsm_screen_get_opts(struct tsm_screen *scr); +void tsm_screen_repeat_char(struct tsm_screen *con, unsigned int num); static inline void screen_inc_age(struct tsm_screen *con) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/src/tsm/libtsm.h new/libtsm-4.4.1/src/tsm/libtsm.h --- old/libtsm-4.3.0/src/tsm/libtsm.h 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/src/tsm/libtsm.h 2026-01-22 10:17:48.000000000 +0100 @@ -377,6 +377,7 @@ #define TSM_VTE_MOUSE_EVENT_ANY 1003 /* sends position on mouse click and mouse move */ #define TSM_VTE_MOUSE_MODE_SGR 1006 /* modern mode that allows unlimited x and y coordinates */ #define TSM_VTE_MOUSE_MODE_PIXEL 1016 /* sends pixel coordinates instead of cell coordinates */ +#define TSM_VTE_BRACKETED_PASTE 2004 /* enclose paste data with escape characters */ enum tsm_mouse_track_mode { TSM_MOUSE_TRACK_DISABLE = 0, /* don't track mouse events */ @@ -520,6 +521,7 @@ unsigned int cell_y, unsigned int pixel_x, unsigned int pixel_y, unsigned int button, unsigned int event, unsigned char flags); +void tsm_vte_paste(struct tsm_vte *vte, const char *data); /** @} */ #ifdef __cplusplus diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/src/tsm/libtsm.sym new/libtsm-4.4.1/src/tsm/libtsm.sym --- old/libtsm-4.3.0/src/tsm/libtsm.sym 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/src/tsm/libtsm.sym 2026-01-22 10:17:48.000000000 +0100 @@ -137,3 +137,8 @@ global: tsm_screen_selection_word; } LIBTSM_4_1; + +LIBTSM_4_4 { +global: + tsm_vte_paste; +} LIBTSM_4_3; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/src/tsm/tsm-screen.c new/libtsm-4.4.1/src/tsm/tsm-screen.c --- old/libtsm-4.3.0/src/tsm/tsm-screen.c 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/src/tsm/tsm-screen.c 2026-01-22 10:17:48.000000000 +0100 @@ -269,6 +269,43 @@ } } +/* Remove num lines from scroll back to current buffer */ +static void remove_from_sb(struct tsm_screen *con, unsigned int num) +{ + struct line *tmp; + + /* TODO: more sophisticated ageing */ + con->age = con->age_cnt; + + if (!con->sb_max || !con->sb_count || !con->sb_last) + return; + + if (num > con->sb_count) + num = con->sb_count; + + while (num--) { + tmp = con->sb_last; + con->sb_last = tmp->prev; + + if (tmp->prev) + tmp->prev->next = NULL; + else + con->sb_first = NULL; + --con->sb_count; + + tmp->next = NULL; + tmp->prev = NULL; + tmp->sb_id = 0; + + if (con->sb_pos == tmp) { + con->sb_pos_num = 0; + con->sb_pos = NULL; + } + memcpy(con->lines[num], tmp, sizeof(*tmp)); + free(tmp); + } +} + static void screen_scroll_up(struct tsm_screen *con, unsigned int num) { unsigned int i, j, max, pos; @@ -730,11 +767,37 @@ /* scroll buffer if screen height shrinks */ if (y < con->size_y) { diff = con->size_y - y; - screen_scroll_up(con, diff); - if (con->cursor_y > diff) - move_cursor(con, con->cursor_x, con->cursor_y - diff); - else - move_cursor(con, con->cursor_x, 0); + if (!con->sb_last || (con->flags & TSM_SCREEN_ALTERNATE)) { + /* If there is nothing in the scrollback buffer, + * Only scroll up if the cursor would go off-screen */ + if (con->cursor_y >= y) { + diff = y - con->cursor_y + 1; + tsm_screen_scroll_up(con, diff); + move_cursor(con, con->cursor_x, y - 1); + } + } else { + tsm_screen_scroll_up(con, diff); + if (con->cursor_y > diff) + move_cursor(con, con->cursor_x, con->cursor_y - diff); + else + move_cursor(con, con->cursor_x, 0); + } + } else if (y > con->size_y) { + diff = y - con->size_y; + if (diff > con->sb_count) + diff = con->sb_count; + /* + * When increasing the terminal number of rows, we can move some + * lines from the scrollback buffer to the main buffer. + */ + if (diff && !(con->flags & TSM_SCREEN_ALTERNATE)) { + con->size_y = y; + con->margin_bottom = con->size_y - 1; + tsm_screen_scroll_down(con, diff); + remove_from_sb(con, diff); + move_cursor(con, con->cursor_x, con->cursor_y + diff); + diff--; + } } con->size_y = y; @@ -1487,6 +1550,36 @@ screen_cell_init(con, &cells[con->cursor_x + i]); } +void tsm_screen_repeat_char(struct tsm_screen *con, unsigned int num) +{ + struct cell *cells; + unsigned int max, i; + + if (!con || !num || !con->size_y || !con->size_x) + return; + + screen_inc_age(con); + /* TODO: more sophisticated ageing */ + con->age = con->age_cnt; + + if (con->cursor_x >= con->size_x) + con->cursor_x = con->size_x - 1; + if (con->cursor_y >= con->size_y) + con->cursor_y = con->size_y - 1; + + if (!con->cursor_x) + return; + + max = con->size_x - con->cursor_x; + if (num > max) + num = max; + + cells = con->lines[con->cursor_y]->cells; + for (i = 0; i < num; i++) + cells[con->cursor_x + i] = cells[con->cursor_x - 1]; + con->cursor_x += num; +} + SHL_EXPORT void tsm_screen_delete_chars(struct tsm_screen *con, unsigned int num) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtsm-4.3.0/src/tsm/tsm-vte.c new/libtsm-4.4.1/src/tsm/tsm-vte.c --- old/libtsm-4.3.0/src/tsm/tsm-vte.c 2025-11-14 10:00:56.000000000 +0100 +++ new/libtsm-4.4.1/src/tsm/tsm-vte.c 2026-01-22 10:17:48.000000000 +0100 @@ -176,6 +176,7 @@ unsigned int mouse_event; unsigned int mouse_last_col; unsigned int mouse_last_row; + bool bracketed_paste; uint8_t (*custom_palette_storage)[3]; uint8_t (*palette)[3]; @@ -1756,6 +1757,9 @@ continue; } continue; + case TSM_VTE_BRACKETED_PASTE: + vte->bracketed_paste = set; + continue; default: llog_debug(vte, "unknown DEC %set-Mode %d", set?"S":"Res", vte->csi_argv[i]); @@ -1798,6 +1802,21 @@ } } +static void csi_report_window_size(struct tsm_vte *vte) +{ + char buf[64]; + unsigned int w, h, len, resp; + + resp = vte->csi_argv[0] == 18 ? 8 : 9; + + w = tsm_screen_get_width(vte->con); + h = tsm_screen_get_height(vte->con); + len = snprintf(buf, sizeof(buf), "\e[%u;%u;%ut", resp, h + 1, w + 1); + if (len >= sizeof(buf)) + return; + vte_write(vte, buf, len); +} + static void do_csi(struct tsm_vte *vte, uint32_t data) { int num, x, y, upper, lower; @@ -2042,6 +2061,16 @@ num = 1; tsm_screen_scroll_down(vte->con, num); break; + case 't': /* ST */ + if (vte->csi_argv[0] == 18 || vte->csi_argv[0] == 19) + csi_report_window_size(vte); + else + llog_debug(vte, "unhandled CSI t sequence %d", vte->csi_argv[0]); + break; + case 'b': /* Repeat last char */ + num = vte->csi_argv[0]; + tsm_screen_repeat_char(vte->con, num); + break; default: llog_debug(vte, "unhandled CSI sequence %c", data); } @@ -2088,7 +2117,7 @@ const char *end_seq, uint8_t r, uint8_t g, uint8_t b) { - char buf[32]; + char buf[64]; snprintf(buf, sizeof(buf), "\e]%s;rgb:%02x%02x/%02x%02x/%02x%02x%s", code, r, r, g, g, b, b, end_seq); vte_write(vte, buf, strlen(buf)); @@ -3246,7 +3275,13 @@ bool pressed = event & TSM_MOUSE_EVENT_PRESSED; /* drop move event if we don't wait for move events */ - if ((vte->mouse_mode == TSM_VTE_MOUSE_MODE_X10 || vte->mouse_event != TSM_VTE_MOUSE_EVENT_ANY) && (event & TSM_MOUSE_EVENT_MOVED)) { + /* In mode 1002 (BTN), accept MOVED with button pressed (drag, button >= 32) */ + /* In mode 1003 (ANY), accept all MOVED events */ + bool is_drag = (button >= 32 && button <= 34); + if ((vte->mouse_mode == TSM_VTE_MOUSE_MODE_X10 || + (vte->mouse_event == TSM_VTE_MOUSE_EVENT_BTN && !is_drag) || + (vte->mouse_event != TSM_VTE_MOUSE_EVENT_BTN && vte->mouse_event != TSM_VTE_MOUSE_EVENT_ANY)) && + (event & TSM_MOUSE_EVENT_MOVED)) { return false; } @@ -3290,13 +3325,18 @@ vte_write(vte, buffer, strlen(buffer)); return true; - } else if (vte->mouse_mode == TSM_VTE_MOUSE_MODE_SGR && vte->mouse_event) { + } else if (vte->mouse_mode == TSM_VTE_MOUSE_MODE_SGR) { if (event & TSM_MOUSE_EVENT_MOVED) { if (cell_x == vte->mouse_last_col && cell_y == vte->mouse_last_row) { return false; } - reply_flags = 35; + /* For drags (button >= 32), use actual button value from reply_flags. + * For hover motion (button < 32, only in mode ANY), use 35 (move marker). */ + if (button < 32) { + reply_flags = 35; + } + /* else: reply_flags already set to button | modifiers for drags */ pressed = true; vte->mouse_last_col = cell_x; @@ -3307,9 +3347,14 @@ vte_write(vte, buffer, strlen(buffer)); return true; - } else if (vte->mouse_mode == TSM_VTE_MOUSE_MODE_PIXEL && vte->mouse_event) { + } else if (vte->mouse_mode == TSM_VTE_MOUSE_MODE_PIXEL) { if (event == TSM_MOUSE_EVENT_MOVED) { - reply_flags = 35; + /* For drags (button >= 32), use actual button value from reply_flags. + * For hover motion (button < 32, only in mode ANY), use 35 (move marker). */ + if (button < 32) { + reply_flags = 35; + } + /* else: reply_flags already set to button | modifiers for drags */ pressed = true; } @@ -3321,3 +3366,25 @@ return false; } + +void tsm_vte_paste(struct tsm_vte *vte, const char *data) +{ + if (!vte || !data) + return; + + if (vte->bracketed_paste) { + const char start[] = "\e[200~"; + const char end[] = "\e[201~"; + char *buf; + int len; + + len = strlen(data) + sizeof(start) + sizeof(end) + 1; + buf = malloc(len); + if (!buf) + return; + snprintf(buf, len, "%s%s%s", start, data, end); + vte_write(vte, buf, strlen(buf)); + free(buf); + } else + vte_write(vte, data, strlen(data)); +} \ No newline at end of file
