From fdef16ae8eb02b4c0c4a53e0bebbdb1247018fbe Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Sun, 17 May 2026 12:56:21 +0800 Subject: [PATCH] tui: refined status / prompt line (M7-3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NORMAL mode status line: before: "-- NORMAL -- (3/100) ↓ 5 new" after : "[reverse-yellow NORMAL] 3 / 100 ▼ 5 new" - the mode is now a small reverse-video yellow chip so it visually echoes the mode colour in the title bar - position is dim grey with em-spaced slash, "▼" replaces "↓" so the unseen-message marker matches the same downward-triangle vocabulary the help screen uses INSERT mode prompt: before: "> " after : "› " (U+203A, dim grey) - single-glyph chevron is quieter than the ASCII ">", aligns with the thinner aesthetic of the new title bar - applied both in tui_render_screen() and tui_render_input() so per-keystroke redraws match the initial paint COMMAND mode prompt: before: ":foo" after : "[magenta :]foo" - the leading colon picks up the COMMAND mode colour so it reads as "you are in command mode now" rather than as part of the typed text --- src/tui.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tui.c b/src/tui.c index d4ad0cb..15dec34 100644 --- a/src/tui.c +++ b/src/tui.c @@ -388,22 +388,28 @@ void tui_render_screen(client_t *client) { /* Status/Input line */ if (client->mode == MODE_INSERT) { - buffer_appendf(buffer, buf_size, &pos, "> \033[K"); + buffer_appendf(buffer, buf_size, &pos, "\033[2;37m›\033[0m \033[K"); } else if (client->mode == MODE_NORMAL) { int total = msg_count; int scroll_pos = client->scroll_pos + 1; if (total == 0) scroll_pos = 0; int unseen = msg_count - end; + /* mode reverse-video chip + dim position + optional unseen marker */ if (unseen > 0) { buffer_appendf(buffer, buf_size, &pos, - "-- NORMAL -- (%d/%d) \033[33m↓ %d new\033[0m\033[K", + "\033[7;33m NORMAL \033[0m" + " \033[2;37m%d / %d\033[0m" + " \033[33m▼ %d new\033[0m\033[K", scroll_pos, total, unseen); } else { buffer_appendf(buffer, buf_size, &pos, - "-- NORMAL -- (%d/%d)\033[K", scroll_pos, total); + "\033[7;33m NORMAL \033[0m" + " \033[2;37m%d / %d\033[0m\033[K", + scroll_pos, total); } } else if (client->mode == MODE_COMMAND) { - buffer_appendf(buffer, buf_size, &pos, ":%s\033[K", client->command_input); + buffer_appendf(buffer, buf_size, &pos, + "\033[35m:\033[0m%s\033[K", client->command_input); } client_send(client, buffer, pos); @@ -445,7 +451,8 @@ void tui_render_input(client_t *client, const char *input) { } /* Move to input line and clear it, then write input */ - snprintf(buffer, sizeof(buffer), "\033[%d;1H" ANSI_CLEAR_LINE "> %s", + snprintf(buffer, sizeof(buffer), + "\033[%d;1H" ANSI_CLEAR_LINE "\033[2;37m›\033[0m %s", rh, display); client_send(client, buffer, strlen(buffer));