From b5656112d724427d6e3bd550cb9b52a545c70837 Mon Sep 17 00:00:00 2001 From: yabu76 Date: Tue, 30 Dec 2025 12:07:43 +0900 Subject: [PATCH] Fix clear_line and print_line to untaint line status --- src/misc.c | 2 +- src/readline.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc.c b/src/misc.c index 271d266..de17170 100644 --- a/src/misc.c +++ b/src/misc.c @@ -256,5 +256,5 @@ int execute_shell_command(int fd, const char *command) void clear_line() { - print("\r\033[K"); + printf("\r\033[K"); } diff --git a/src/readline.c b/src/readline.c index 27125c6..8742e4c 100644 --- a/src/readline.c +++ b/src/readline.c @@ -42,11 +42,11 @@ typedef struct readline_s void print_line(readline_t *rl) { clear_line(); - print("%s%s", rl->prompt, rl->line); - print("\r"); // Move the cursor back to the beginning + printf("%s%s", rl->prompt, rl->line); + printf("\r"); // Move the cursor back to the beginning for (int i = 0; i < rl->prompt_length + rl->cursor_pos; ++i) { - print("\x1b[C"); // Move the cursor right + printf("\x1b[C"); // Move the cursor right } }