Control: tags -1 +patch +pending
Dear maintainer,
I've prepared an NMU for libtsm (versioned as 4.4.2-0.1) and
uploaded it to DELAYED/7. Please feel free to tell me if I
should cancel it.
Regards.
diffstat for libtsm-4.3.0 libtsm-4.4.2
NEWS.md
| 29 ++
README
| 60 -----
README.md
| 64 ++++--
debian/changelog
| 13 +
debian/libtsm4.symbols
| 2
debian/patches/0001-tsm-meson.build-Change-library-build-to-both_librari.patch
| 13 -
debian/rules
| 9
meson.build
| 2
src/tsm/libtsm-int.h
| 1
src/tsm/libtsm.h
| 2
src/tsm/libtsm.sym
| 5
src/tsm/meson.build
| 5
src/tsm/tsm-screen.c
| 102 +++++++++
src/tsm/tsm-vte.c
| 103 +++++++++-
14 files changed, 309 insertions(+), 101 deletions(-)
diff -Nru libtsm-4.3.0/debian/changelog libtsm-4.4.2/debian/changelog
--- libtsm-4.3.0/debian/changelog 2026-01-05 00:51:23.000000000 -0500
+++ libtsm-4.4.2/debian/changelog 2026-01-31 23:48:57.000000000 -0500
@@ -1,3 +1,16 @@
+libtsm (4.4.2-0.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * New upstream release. (Closes: #1126432, #1125286)
+ * debian/rules: Explicitly define -Dtests=false configure flag when
+ nocheck profile is detected. (Closes: #1126497)
+ * debian/patches/:
+ + 0001-tsm-meson.build-Change-library-build-to-both_librari.patch:
+ Refresh the patch.
+ * debian/libtsm4.symbols: Record new symbols.
+
+ -- Boyuan Yang <[email protected]> Sat, 31 Jan 2026 23:48:57 -0500
+
libtsm (4.3.0-2) unstable; urgency=medium
* d/watch: Fix file format (Closes: #1124637)
diff -Nru libtsm-4.3.0/debian/libtsm4.symbols
libtsm-4.4.2/debian/libtsm4.symbols
--- libtsm-4.3.0/debian/libtsm4.symbols 2026-01-05 00:51:23.000000000 -0500
+++ libtsm-4.4.2/debian/libtsm4.symbols 2026-01-31 23:48:57.000000000 -0500
@@ -6,6 +6,7 @@
LIBTSM_4@LIBTSM_4 4.3.0
LIBTSM_4_1@LIBTSM_4_1 4.3.0
LIBTSM_4_3@LIBTSM_4_3 4.3.0
+ LIBTSM_4_4@LIBTSM_4_4 4.4.2
tsm_screen_clear_sb@LIBTSM_3 4.3.0
tsm_screen_delete_chars@LIBTSM_3 4.3.0
tsm_screen_delete_lines@LIBTSM_3 4.3.0
@@ -75,6 +76,7 @@
tsm_vte_hard_reset@LIBTSM_3 4.3.0
tsm_vte_input@LIBTSM_3 4.3.0
tsm_vte_new@LIBTSM_3 4.3.0
+ tsm_vte_paste@LIBTSM_4_4 4.4.2
tsm_vte_ref@LIBTSM_3 4.3.0
tsm_vte_reset@LIBTSM_3 4.3.0
tsm_vte_set_backspace_sends_delete@LIBTSM_4_1 4.3.0
diff -Nru libtsm-4.3.0/debian/patches/0001-tsm-meson.build-Change-library-build-to-both_librari.patch
libtsm-4.4.2/debian/patches/0001-tsm-meson.build-Change-library-build-to-both_librari.patch
---
libtsm-4.3.0/debian/patches/0001-tsm-meson.build-Change-library-build-to-both_librari.patch
2026-01-05 00:51:23.000000000 -0500
+++
libtsm-4.4.2/debian/patches/0001-tsm-meson.build-Change-library-build-to-both_librari.patch
2026-01-31 23:34:18.000000000 -0500
@@ -1,26 +1,27 @@
-From 1fe31aa3253891a043de365677c36a22a4ab5333 Mon Sep 17 00:00:00 2001
+From f66b49bd424c963aed33c52b0badb2a5464a0dc3 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <[email protected]>
Date: Sat, 3 Jan 2026 06:19:42 +0900
Subject: [PATCH] tsm/meson.build: Change library build to both_libraries
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
+Last-Update: 2026-01-31
---
src/tsm/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tsm/meson.build b/src/tsm/meson.build
-index 938b93a..dc9e0e0 100644
+index 752442b..4f1a257 100644
--- a/src/tsm/meson.build
+++ b/src/tsm/meson.build
-@@ -24,7 +24,7 @@ if not cc.links(code, args: link_flags, name:
'-Wl,--version-script=...')
- endif
- endif
+@@ -26,7 +26,7 @@ endif
+
+ deps = [wcwidth_dep, shl_dep, xkbcommon_dep]
-libtsm = shared_library(
+libtsm = both_libraries(
'tsm',
libtsm_srcs,
- dependencies: [wcwidth_dep, shl_dep, xkbcommon_dep],
+ dependencies: deps,
--
2.51.0
diff -Nru libtsm-4.3.0/debian/rules libtsm-4.4.2/debian/rules
--- libtsm-4.3.0/debian/rules 2026-01-05 00:51:23.000000000 -0500
+++ libtsm-4.4.2/debian/rules 2026-01-31 23:45:28.000000000 -0500
@@ -8,6 +8,15 @@
export DEB_BUILD_MAINT_OPTIONS := qa=+bug hardening=+all reproducible=+all
export DPKG_GENSYMBOLS_CHECK_LEVEL := 4
+ifneq ($(filter nocheck,$(DEB_BUILD_PROFILES)),)
+ CONFIGURE_FLAGS += -Dtests=false
+else
+ CONFIGURE_FLAGS += -Dtests=true
+endif
+
%:
dh $@ --builddirectory=build/ \
--buildsystem=meson
+
+override_dh_auto_configure:
+ dh_auto_configure -- $(CONFIGURE_FLAGS)
diff -Nru libtsm-4.3.0/meson.build libtsm-4.4.2/meson.build
--- libtsm-4.3.0/meson.build 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/meson.build 2026-01-29 04:45:44.000000000 -0500
@@ -3,7 +3,7 @@
project(
'libtsm',
'c',
- version: '4.3.0',
+ version: '4.4.2',
license: 'MIT',
meson_version: '>=1.1',
default_options: [
diff -Nru libtsm-4.3.0/NEWS.md libtsm-4.4.2/NEWS.md
--- libtsm-4.3.0/NEWS.md 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/NEWS.md 2026-01-29 04:45:44.000000000 -0500
@@ -1,5 +1,34 @@
# libtsm Release News
+## CHANGES WITH 4.4.2
+### New features
+* add nord color scheme by @kdj0c in https://github.com/kmscon/libtsm/pull/21
+* meson: include tsm's deps in libtsm_dep by @1ace in
https://github.com/kmscon/libtsm/pull/19
+### Bug Fixes
+* Fix CSI 18t and 19t reporting size. by @kdj0c in
https://github.com/kmscon/libtsm/pull/20
+* resize: Fix a corner case when resizing by @kdj0c in
https://github.com/kmscon/libtsm/pull/22
+
+## New Contributors
+* @1ace made their first contribution in
https://github.com/kmscon/libtsm/pull/19
+
+## 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 -Nru libtsm-4.3.0/README libtsm-4.4.2/README
--- libtsm-4.3.0/README 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/README 1969-12-31 19:00:00.000000000 -0500
@@ -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 -Nru libtsm-4.3.0/README.md libtsm-4.4.2/README.md
--- libtsm-4.3.0/README.md 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/README.md 2026-01-29 04:45:44.000000000 -0500
@@ -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 -Nru libtsm-4.3.0/src/tsm/libtsm.h libtsm-4.4.2/src/tsm/libtsm.h
--- libtsm-4.3.0/src/tsm/libtsm.h 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/src/tsm/libtsm.h 2026-01-29 04:45:44.000000000 -0500
@@ -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 -Nru libtsm-4.3.0/src/tsm/libtsm-int.h libtsm-4.4.2/src/tsm/libtsm-int.h
--- libtsm-4.3.0/src/tsm/libtsm-int.h 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/src/tsm/libtsm-int.h 2026-01-29 04:45:44.000000000 -0500
@@ -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 -Nru libtsm-4.3.0/src/tsm/libtsm.sym libtsm-4.4.2/src/tsm/libtsm.sym
--- libtsm-4.3.0/src/tsm/libtsm.sym 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/src/tsm/libtsm.sym 2026-01-29 04:45:44.000000000 -0500
@@ -137,3 +137,8 @@
global:
tsm_screen_selection_word;
} LIBTSM_4_1;
+
+LIBTSM_4_4 {
+global:
+ tsm_vte_paste;
+} LIBTSM_4_3;
diff -Nru libtsm-4.3.0/src/tsm/meson.build libtsm-4.4.2/src/tsm/meson.build
--- libtsm-4.3.0/src/tsm/meson.build 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/src/tsm/meson.build 2026-01-29 04:45:44.000000000 -0500
@@ -24,10 +24,12 @@
endif
endif
+deps = [wcwidth_dep, shl_dep, xkbcommon_dep]
+
libtsm = shared_library(
'tsm',
libtsm_srcs,
- dependencies: [wcwidth_dep, shl_dep, xkbcommon_dep],
+ dependencies: deps,
install: true,
version: version,
soversion: major,
@@ -37,6 +39,7 @@
libtsm_dep = declare_dependency(
include_directories: '.',
link_with: libtsm,
+ dependencies: deps,
sources: libtsm_srcs,
)
diff -Nru libtsm-4.3.0/src/tsm/tsm-screen.c libtsm-4.4.2/src/tsm/tsm-screen.c
--- libtsm-4.3.0/src/tsm/tsm-screen.c 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/src/tsm/tsm-screen.c 2026-01-29 04:45:44.000000000 -0500
@@ -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,36 @@
/* 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 = con->cursor_y - 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);
+ }
}
con->size_y = y;
@@ -1487,6 +1549,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 -Nru libtsm-4.3.0/src/tsm/tsm-vte.c libtsm-4.4.2/src/tsm/tsm-vte.c
--- libtsm-4.3.0/src/tsm/tsm-vte.c 2025-11-14 04:00:56.000000000 -0500
+++ libtsm-4.4.2/src/tsm/tsm-vte.c 2026-01-29 04:45:44.000000000 -0500
@@ -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];
@@ -242,6 +243,28 @@
[TSM_COLOR_BACKGROUND] = { 0, 0, 0 }, /* black */
};
+static uint8_t color_palette_nord[TSM_COLOR_NUM][3] = {
+ [TSM_COLOR_BLACK] = { 59, 66, 82 }, /* black */
+ [TSM_COLOR_RED] = { 191, 97, 106 }, /* red */
+ [TSM_COLOR_GREEN] = { 163, 190, 140 }, /* green */
+ [TSM_COLOR_YELLOW] = { 235, 203, 139 }, /* yellow */
+ [TSM_COLOR_BLUE] = { 129, 161, 193 }, /* blue */
+ [TSM_COLOR_MAGENTA] = { 180, 142, 173 }, /* magenta */
+ [TSM_COLOR_CYAN] = { 136, 192, 208 }, /* cyan */
+ [TSM_COLOR_LIGHT_GREY] = { 229, 233, 240 }, /* light grey */
+ [TSM_COLOR_DARK_GREY] = { 76, 86, 106 }, /* dark grey */
+ [TSM_COLOR_LIGHT_RED] = { 191, 97, 106 }, /* light red */
+ [TSM_COLOR_LIGHT_GREEN] = { 163, 190, 140 }, /* light green */
+ [TSM_COLOR_LIGHT_YELLOW] = { 235, 203, 139 }, /* light yellow */
+ [TSM_COLOR_LIGHT_BLUE] = { 129, 161, 193 }, /* light blue */
+ [TSM_COLOR_LIGHT_MAGENTA] = { 180, 142, 173 }, /* light magenta */
+ [TSM_COLOR_LIGHT_CYAN] = { 143, 188, 187 }, /* light cyan */
+ [TSM_COLOR_WHITE] = { 236, 239, 244 }, /* white */
+
+ [TSM_COLOR_FOREGROUND] = { 216, 222, 233 }, /* light grey */
+ [TSM_COLOR_BACKGROUND] = { 46, 52, 64 }, /* black */
+};
+
static uint8_t color_palette_solarized[TSM_COLOR_NUM][3] = {
[TSM_COLOR_BLACK] = { 7, 54, 66 }, /* black */
[TSM_COLOR_RED] = { 220, 50, 47 }, /* red */
@@ -381,6 +404,8 @@
if (!strcmp(vte->palette_name, "custom") && vte->custom_palette_storage)
return vte->custom_palette_storage;
+ if (!strcmp(vte->palette_name, "nord"))
+ return color_palette_nord;
if (!strcmp(vte->palette_name, "solarized"))
return color_palette_solarized;
if (!strcmp(vte->palette_name, "solarized-black"))
@@ -1756,6 +1781,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 +1826,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, w);
+ 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 +2085,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 +2141,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 +3299,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 +3349,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 +3371,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 +3390,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