linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 5a8a969895169da56d9be4e2abffeb2a730d1397
parent 4558a8cdd3d131f624df1fa71fc0844a72e3e2d2
Author: Jul <jul@9o.is>
Date:   Thu, 31 Jul 2025 22:17:22 -0400

refactor fzy truncate patch

Diffstat:
Mpkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch | 30++++++------------------------
1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/pkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch b/pkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch @@ -1,39 +1,21 @@ -From 46c48eae9ebfd86f9d6ba51ac73438b10d242c9b Mon Sep 17 00:00:00 2001 +From 9496f88eda3de63e1cced43398402a53f6ee21de 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(+) + src/tty_interface.c | 4 ++++ + 1 file changed, 4 insertions(+) diff --git a/src/tty_interface.c b/src/tty_interface.c -index ecff1d6..62f20ac 100644 +index ecff1d6..9944af1 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 +@@ -179,6 +179,10 @@ static void draw_match(tty_interface_t *state, const char *choice, int selected) 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) { ++ if (i >= tty_getwidth(state->tty) - 5) { + tty_printf(tty, "..."); + break; + }