linux-qubasis

linux oasis port as a qubes template

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

commit 1363433159926b3a8467f25b8915ce03c59182f2
parent 4870e8ea8f546e3aedb59e2f3fdf09d320c2cafd
Author: Jul <jul@9o.is>
Date:   Mon,  4 Aug 2025 23:06:21 -0400

fzy: fix tty clearline in multi selection

Diffstat:
Mpkg/fzy/patches/0001-add-carriage-return-to-tty_clearline.patch | 2+-
Mpkg/fzy/patches/0002-Reduce-screen-and-cursor-flickering.patch | 2+-
Mpkg/fzy/patches/0003-add-multi-selection.patch | 26++++++++++++++------------
Mpkg/fzy/patches/0004-truncate-entries-to-terminal-width.patch | 4++--
Mpkg/fzy/patches/0005-add-half-page-up-down-vi-actions.patch | 10+++++-----
Mpkg/fzy/patches/0006-inline-info-data.patch | 10+++++-----
6 files changed, 28 insertions(+), 26 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,4 +1,4 @@ -From a7f705a08f5a10b0cdb76ffddd1dee0e3d06ea48 Mon Sep 17 00:00:00 2001 +From 7cd948b993f9ad5a9dfe69ed023c2091f79e93dc Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 00:13:39 -0400 Subject: [PATCH 1/6] add carriage return to tty_clearline 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,4 +1,4 @@ -From 03c3ef3fd9e0638331453db4bbdec091f61c1572 Mon Sep 17 00:00:00 2001 +From 4a167fd5abf1ff1abd4a8234624290edfa05e0e9 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/6] Reduce screen and cursor flickering diff --git a/pkg/fzy/patches/0003-add-multi-selection.patch b/pkg/fzy/patches/0003-add-multi-selection.patch @@ -1,12 +1,12 @@ -From d8f69837fff03162e77c7eabacc39fbb4d139f15 Mon Sep 17 00:00:00 2001 +From 4ce0a1d7d2c98f5f1d02aad2a26207fa2c7fb296 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 03:34:16 -0400 Subject: [PATCH 3/6] add multi-selection --- src/config.def.h | 1 + - src/tty_interface.c | 165 ++++++++++++++++++++++++++++++++++++++++++-- - 2 files changed, 160 insertions(+), 6 deletions(-) + src/tty_interface.c | 167 ++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 162 insertions(+), 6 deletions(-) diff --git a/src/config.def.h b/src/config.def.h index 00d3740..27a83ce 100644 @@ -21,7 +21,7 @@ index 00d3740..27a83ce 100644 #ifdef __cplusplus } diff --git a/src/tty_interface.c b/src/tty_interface.c -index 6828be8..fc2a59a 100644 +index 6828be8..ee36845 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c @@ -7,6 +7,126 @@ @@ -160,11 +160,13 @@ index 6828be8..fc2a59a 100644 size_t line = 0; while (line++ < state->options->num_lines + (state->options->show_info ? 1 : 0)) { tty_newline(tty); -@@ -92,11 +212,14 @@ static void draw(tty_interface_t *state) { +@@ -92,11 +212,16 @@ static void draw(tty_interface_t *state) { } tty_hide_cursor(tty); - tty_setcol(tty, 0); ++ tty_setcol(tty, 0); ++ tty_clearline(tty); + tty_setcol(tty, DEFAULT_MULTI ? 2 : 0); tty_printf(tty, "%s%s", options->prompt, state->search); tty_clearline(tty); @@ -177,7 +179,7 @@ index 6828be8..fc2a59a 100644 tty_printf(tty, "\n[%lu/%lu]", choices->available, choices->size); tty_clearline(tty); } -@@ -106,6 +229,11 @@ static void draw(tty_interface_t *state) { +@@ -106,6 +231,11 @@ static void draw(tty_interface_t *state) { tty_clearline(tty); const char *choice = choices_get(choices, i); if (choice) { @@ -189,7 +191,7 @@ index 6828be8..fc2a59a 100644 draw_match(state, choice, i == choices->selection); } } -@@ -113,7 +241,7 @@ static void draw(tty_interface_t *state) { +@@ -113,7 +243,7 @@ static void draw(tty_interface_t *state) { if (num_lines + options->show_info) tty_moveup(tty, num_lines + options->show_info); @@ -198,7 +200,7 @@ index 6828be8..fc2a59a 100644 fputs(options->prompt, tty->fout); for (size_t i = 0; i < state->cursor; i++) fputc(state->search[i], tty->fout); -@@ -137,6 +265,22 @@ static void update_state(tty_interface_t *state) { +@@ -137,6 +267,22 @@ static void update_state(tty_interface_t *state) { static void action_emit(tty_interface_t *state) { update_state(state); @@ -221,7 +223,7 @@ index 6828be8..fc2a59a 100644 /* Reset the tty as close as possible to the previous state */ clear(state); -@@ -239,6 +383,10 @@ static void action_pagedown(tty_interface_t *state) { +@@ -239,6 +385,10 @@ static void action_pagedown(tty_interface_t *state) { } static void action_autocomplete(tty_interface_t *state) { @@ -232,7 +234,7 @@ index 6828be8..fc2a59a 100644 update_state(state); const char *current_selection = choices_get(state->choices, state->choices->selection); if (current_selection) { -@@ -377,6 +525,7 @@ static void handle_input(tty_interface_t *state, const char *s, int handle_ambig +@@ -377,6 +527,7 @@ static void handle_input(tty_interface_t *state, const char *s, int handle_ambig } int tty_interface_run(tty_interface_t *state) { @@ -240,7 +242,7 @@ index 6828be8..fc2a59a 100644 draw(state); for (;;) { -@@ -392,8 +541,10 @@ int tty_interface_run(tty_interface_t *state) { +@@ -392,8 +543,10 @@ int tty_interface_run(tty_interface_t *state) { if (state->ambiguous_key_pending == 1) continue; @@ -252,7 +254,7 @@ index 6828be8..fc2a59a 100644 draw(state); } while (tty_input_ready(state->tty, state->ambiguous_key_pending ? KEYTIMEOUT : 0, 0)); -@@ -402,8 +553,10 @@ int tty_interface_run(tty_interface_t *state) { +@@ -402,8 +555,10 @@ int tty_interface_run(tty_interface_t *state) { char s[1] = ""; handle_input(state, s, 1); 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,4 +1,4 @@ -From 9de07c643f5b9efc5d9e69a2ccbfb8500486543a Mon Sep 17 00:00:00 2001 +From 0dce1ecf12d53a03d89d33f81c0bd6f441189373 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 05:34:48 -0400 Subject: [PATCH 4/6] truncate entries to terminal width @@ -8,7 +8,7 @@ Subject: [PATCH 4/6] truncate entries to terminal width 1 file changed, 4 insertions(+) diff --git a/src/tty_interface.c b/src/tty_interface.c -index fc2a59a..1e643a5 100644 +index ee36845..2025abb 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c @@ -179,6 +179,10 @@ static void draw_match(tty_interface_t *state, const char *choice, int selected) diff --git a/pkg/fzy/patches/0005-add-half-page-up-down-vi-actions.patch b/pkg/fzy/patches/0005-add-half-page-up-down-vi-actions.patch @@ -1,4 +1,4 @@ -From af3bd5f0af329439923fa98f1398583ae859dfac Mon Sep 17 00:00:00 2001 +From e312ce929748ea9e0d29de04da93ef0100f561fc Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 22:37:31 -0400 Subject: [PATCH 5/6] add half page up down vi actions @@ -8,10 +8,10 @@ Subject: [PATCH 5/6] add half page up down vi actions 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/tty_interface.c b/src/tty_interface.c -index 1e643a5..3dc00f0 100644 +index 2025abb..18e40f1 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c -@@ -331,11 +331,6 @@ static void action_del_word(tty_interface_t *state) { +@@ -333,11 +333,6 @@ static void action_del_word(tty_interface_t *state) { state->cursor = cursor; } @@ -23,7 +23,7 @@ index 1e643a5..3dc00f0 100644 static void action_prev(tty_interface_t *state) { update_state(state); choices_prev(state->choices); -@@ -350,6 +345,18 @@ static void action_next(tty_interface_t *state) { +@@ -352,6 +347,18 @@ static void action_next(tty_interface_t *state) { choices_next(state->choices); } @@ -42,7 +42,7 @@ index 1e643a5..3dc00f0 100644 static void action_left(tty_interface_t *state) { if (state->cursor > 0) { state->cursor--; -@@ -449,16 +456,16 @@ static const keybinding_t keybindings[] = {{"\x1b", action_exit}, /* ESC * +@@ -451,16 +458,16 @@ static const keybinding_t keybindings[] = {{"\x1b", action_exit}, /* ESC * {KEY_CTRL('H'), action_del_char}, /* Backspace (C-H) */ {KEY_CTRL('W'), action_del_word}, /* C-W */ diff --git a/pkg/fzy/patches/0006-inline-info-data.patch b/pkg/fzy/patches/0006-inline-info-data.patch @@ -1,4 +1,4 @@ -From c1ee71ca445906dafee4e4f640f0c6b99bf98a01 Mon Sep 17 00:00:00 2001 +From f1db793ef8f73ac9d853b98a01a7af0cba96a3a0 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Thu, 31 Jul 2025 23:25:23 -0400 Subject: [PATCH 6/6] inline info data @@ -8,7 +8,7 @@ Subject: [PATCH 6/6] inline info data 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/tty_interface.c b/src/tty_interface.c -index 3dc00f0..67a859e 100644 +index 18e40f1..0e63989 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c @@ -140,7 +140,7 @@ static void clear(tty_interface_t *state) { @@ -20,8 +20,8 @@ index 3dc00f0..67a859e 100644 tty_newline(tty); } tty_clearline(tty); -@@ -218,13 +218,12 @@ static void draw(tty_interface_t *state) { - tty_hide_cursor(tty); +@@ -220,13 +220,12 @@ static void draw(tty_interface_t *state) { + tty_clearline(tty); tty_setcol(tty, DEFAULT_MULTI ? 2 : 0); tty_printf(tty, "%s%s", options->prompt, state->search); - tty_clearline(tty); @@ -36,7 +36,7 @@ index 3dc00f0..67a859e 100644 tty_clearline(tty); } -@@ -242,8 +241,8 @@ static void draw(tty_interface_t *state) { +@@ -244,8 +243,8 @@ static void draw(tty_interface_t *state) { } }