linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit 6d4453e03f218596b974b3f044e85fa3fdc1973d parent 39c59ae129f4b98b1335ce65a0a264cf98ad7959 Author: Jul <jul@9o.is> Date: Thu, 31 Jul 2025 05:35:52 -0400 truncate fzy entries to terminal width Diffstat:
| M | pkg/fzy/patches/0001-add-carriage-return-to-tty_clearline.patch | | | 2 | +- |
| M | pkg/fzy/patches/0002-Reduce-screen-and-cursor-flickering.patch | | | 2 | +- |
| M | pkg/fzy/patches/0003-add-multi-selection.patch | | | 2 | +- |
| A | pkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
4 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/pkg/fzy/patches/0001-add-carriage-return-to-tty_clearline.patch b/pkg/fzy/patches/0001-add-carriage-return-to-tty_clearline.patch @@ -1,7 +1,7 @@ From a7f705a08f5a10b0cdb76ffddd1dee0e3d06ea48 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 00:13:39 -0400 -Subject: [PATCH 1/3] add carriage return to tty_clearline +Subject: [PATCH 1/4] add carriage return to tty_clearline --- src/tty.c | 2 +- diff --git a/pkg/fzy/patches/0002-Reduce-screen-and-cursor-flickering.patch b/pkg/fzy/patches/0002-Reduce-screen-and-cursor-flickering.patch @@ -1,7 +1,7 @@ From 03c3ef3fd9e0638331453db4bbdec091f61c1572 Mon Sep 17 00:00:00 2001 From: leo-arch <leonardoabramovich2@gmail.com> Date: Fri, 18 Jul 2025 21:39:07 -0300 -Subject: [PATCH 2/3] Reduce screen and cursor flickering +Subject: [PATCH 2/4] Reduce screen and cursor flickering --- src/tty.c | 8 ++++++++ diff --git a/pkg/fzy/patches/0003-add-multi-selection.patch b/pkg/fzy/patches/0003-add-multi-selection.patch @@ -1,7 +1,7 @@ From 1dc1c60924da9ab2d8af80cf89b59b65a2e81ff8 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 03:34:16 -0400 -Subject: [PATCH 3/3] add multi-selection +Subject: [PATCH 3/4] add multi-selection --- src/options.c | 8 ++- diff --git a/pkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch b/pkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch @@ -0,0 +1,45 @@ +From f114be31ff2eec623cc3b4a960017b47a23e783f Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Thu, 31 Jul 2025 05:34:48 -0400 +Subject: [PATCH 4/4] truncate entries to terminal width + +--- + src/tty_interface.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/src/tty_interface.c b/src/tty_interface.c +index a0392bd..711b797 100644 +--- a/src/tty_interface.c ++++ b/src/tty_interface.c +@@ -2,6 +2,8 @@ + #include <stdio.h> + #include <stdlib.h> + #include <string.h> ++#include <unistd.h> ++#include <sys/ioctl.h> + + #include "match.h" + #include "tty_interface.h" +@@ -178,7 +180,19 @@ static void draw_match(tty_interface_t *state, const char *choice, int selected) + #endif + + tty_setnowrap(tty); ++ struct winsize w; ++ ++ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == -1) { ++ perror("ioctl"); ++ exit(EXIT_FAILURE); ++ } ++ size_t max_width = w.ws_col - 5; ++ + for (size_t i = 0, p = 0; choice[i] != '\0'; i++) { ++ if (i >= max_width) { ++ tty_printf(tty, "..."); ++ break; ++ } + if (positions[p] == i) { + tty_setfg(tty, TTY_COLOR_HIGHLIGHT); + p++; +-- +2.50.1 +