linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
0003-truncate-lines-to-terminal-width.patch
(773B)
1 From 17a36a608407996c2c350ffc7d58669e5d796714 Mon Sep 17 00:00:00 2001
2 From: Jul <jul@qh.is>
3 Date: Thu, 31 Jul 2025 05:34:48 -0400
4 Subject: [PATCH] truncate lines to terminal width
5
6 ---
7 src/tty_interface.c | 4 ++++
8 1 file changed, 4 insertions(+)
9
10 diff --git a/src/tty_interface.c b/src/tty_interface.c
11 index 02c26a0..aed8a21 100644
12 --- a/src/tty_interface.c
13 +++ b/src/tty_interface.c
14 @@ -59,6 +59,10 @@ static void draw_match(tty_interface_t *state, const char *choice, int selected)
15
16 tty_setnowrap(tty);
17 for (size_t i = 0, p = 0; choice[i] != '\0'; i++) {
18 + if (i >= tty_getwidth(state->tty) - 5) {
19 + tty_printf(tty, "...");
20 + break;
21 + }
22 if (positions[p] == i) {
23 tty_setfg(tty, TTY_COLOR_HIGHLIGHT);
24 p++;
25 --
26 2.51.0
27