fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 350d51de00c1616774aab2504343e3b35c881032 parent 5b80bb0bc7c6283f297570aa7c3a1226889f8202 Author: Jul <jul@9o.is> Date: Tue, 5 Aug 2025 02:37:51 -0400 fix clearline issues for use in editor Diffstat:
| M | src/tty.c | | | 2 | +- |
| M | src/tty_interface.c | | | 5 | +++-- |
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/tty.c b/src/tty.c @@ -165,7 +165,7 @@ void tty_newline(tty_t *tty) { } void tty_clearline(tty_t *tty) { - tty_printf(tty, "%c%cK", 0x1b, '['); + tty_printf(tty, "%c%c2K\r", 0x1b, '['); } void tty_setcol(tty_t *tty, int col) { diff --git a/src/tty_interface.c b/src/tty_interface.c @@ -92,12 +92,13 @@ static void draw(tty_interface_t *state) { } tty_setcol(tty, 0); - tty_printf(tty, "%s%s", options->prompt, state->search); tty_clearline(tty); + tty_printf(tty, "%s%s", options->prompt, state->search); if (options->show_info) { - tty_printf(tty, "\n[%lu/%lu]", choices->available, choices->size); + tty_printf(tty, "\n"); tty_clearline(tty); + tty_printf(tty, "[%lu/%lu]", choices->available, choices->size); } for (size_t i = start; i < start + num_lines; i++) {