linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
0001-fix-clearline-issues-for-use-in-editor.patch
(1272B)
1 From 261aed15e27d8603979b4caec40377c7834027cb Mon Sep 17 00:00:00 2001
2 From: Jul <jul@qh.is>
3 Date: Tue, 5 Aug 2025 02:37:51 -0400
4 Subject: [PATCH] fix clearline issues for use in editor
5
6 ---
7 src/tty.c | 2 +-
8 src/tty_interface.c | 5 +++--
9 2 files changed, 4 insertions(+), 3 deletions(-)
10
11 diff --git a/src/tty.c b/src/tty.c
12 index b8a555d..bc20c0a 100644
13 --- a/src/tty.c
14 +++ b/src/tty.c
15 @@ -165,7 +165,7 @@ void tty_newline(tty_t *tty) {
16 }
17
18 void tty_clearline(tty_t *tty) {
19 - tty_printf(tty, "%c%cK", 0x1b, '[');
20 + tty_printf(tty, "%c%c2K\r", 0x1b, '[');
21 }
22
23 void tty_setcol(tty_t *tty, int col) {
24 diff --git a/src/tty_interface.c b/src/tty_interface.c
25 index 343dde8..59c9c74 100644
26 --- a/src/tty_interface.c
27 +++ b/src/tty_interface.c
28 @@ -92,12 +92,13 @@ static void draw(tty_interface_t *state) {
29 }
30
31 tty_setcol(tty, 0);
32 - tty_printf(tty, "%s%s", options->prompt, state->search);
33 tty_clearline(tty);
34 + tty_printf(tty, "%s%s", options->prompt, state->search);
35
36 if (options->show_info) {
37 - tty_printf(tty, "\n[%lu/%lu]", choices->available, choices->size);
38 + tty_printf(tty, "\n");
39 tty_clearline(tty);
40 + tty_printf(tty, "[%lu/%lu]", choices->available, choices->size);
41 }
42
43 for (size_t i = start; i < start + num_lines; i++) {
44 --
45 2.51.0
46