linux-qubasis

linux oasis port as a qubes template

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

commit 7f14bab1706dc0220bd09f27428e46f5e475867d
parent ca0c07c018aa7eb955ca4f0ac2c091f4ed5be13c
Author: Jul <jul@9o.is>
Date:   Thu, 31 Jul 2025 02:01:06 -0400

reduce screen flickering in fzy

Diffstat:
Mpkg/fzy/patches/0001-add-carriage-return-to-tty_clearline.patch | 4++--
Apkg/fzy/patches/0002-Reduce-screen-and-cursor-flickering.patch | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 97 insertions(+), 2 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 9f4bd0fb1f050b66bb902c3512ec33fab0990e47 Mon Sep 17 00:00:00 2001 +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] add carriage return to tty_clearline +Subject: [PATCH 1/2] 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 @@ -0,0 +1,95 @@ +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/2] Reduce screen and cursor flickering + +--- + src/tty.c | 8 ++++++++ + src/tty.h | 3 +++ + src/tty_interface.c | 14 +++++++++++--- + 3 files changed, 22 insertions(+), 3 deletions(-) + +diff --git a/src/tty.c b/src/tty.c +index a8f0826..ae4e000 100644 +--- a/src/tty.c ++++ b/src/tty.c +@@ -198,3 +198,11 @@ size_t tty_getwidth(tty_t *tty) { + size_t tty_getheight(tty_t *tty) { + return tty->maxheight; + } ++ ++void tty_hide_cursor(tty_t *tty) { ++ fputs("\x1b[?25l", tty->fout); ++} ++ ++void tty_unhide_cursor(tty_t *tty) { ++ fputs("\x1b[?25h", tty->fout); ++} +diff --git a/src/tty.h b/src/tty.h +index 210f690..3c54f1d 100644 +--- a/src/tty.h ++++ b/src/tty.h +@@ -63,6 +63,9 @@ void tty_flush(tty_t *tty); + size_t tty_getwidth(tty_t *tty); + size_t tty_getheight(tty_t *tty); + ++void tty_hide_cursor(tty_t *tty); ++void tty_unhide_cursor(tty_t *tty); ++ + #ifdef __cplusplus + } + #endif +diff --git a/src/tty_interface.c b/src/tty_interface.c +index 343dde8..6828be8 100644 +--- a/src/tty_interface.c ++++ b/src/tty_interface.c +@@ -91,6 +91,7 @@ static void draw(tty_interface_t *state) { + } + } + ++ tty_hide_cursor(tty); + tty_setcol(tty, 0); + tty_printf(tty, "%s%s", options->prompt, state->search); + tty_clearline(tty); +@@ -116,6 +117,8 @@ static void draw(tty_interface_t *state) { + fputs(options->prompt, tty->fout); + for (size_t i = 0; i < state->cursor; i++) + fputc(state->search[i], tty->fout); ++ ++ tty_unhide_cursor(tty); + tty_flush(tty); + } + +@@ -353,14 +356,16 @@ static void handle_input(tty_interface_t *state, const char *s, int handle_ambig + + /* We could have a complete keybinding, or could be in the middle of one. + * We'll need to wait a few milliseconds to find out. */ +- if (found_keybinding != -1 && in_middle) { ++/* if (found_keybinding != -1 && in_middle) { + state->ambiguous_key_pending = 1; + return; +- } ++ } */ + + /* Wait for more if we are in the middle of a keybinding */ +- if (in_middle) ++ if (in_middle) { ++ state->ambiguous_key_pending = 1; + return; ++ } + + /* No matching keybinding, add to search */ + for (int i = 0; input[i]; i++) +@@ -384,6 +389,9 @@ int tty_interface_run(tty_interface_t *state) { + char s[2] = {tty_getchar(state->tty), '\0'}; + handle_input(state, s, 0); + ++ if (state->ambiguous_key_pending == 1) ++ continue; ++ + if (state->exit >= 0) + return state->exit; + +-- +2.50.1 +