Skip to content

Commit 0e3666d

Browse files
committed
Style the input cursor yellow underline in safe mode
1 parent 2821c3b commit 0e3666d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ All notable changes to Sofos are documented in this file.
3333
- **A panicking worker no longer prints a zeroed session summary.** The shutdown path now carries an explicit `panicked` flag so the goodbye line is preceded by a "Session ended unexpectedly" warning instead of pretending the run finished cleanly with no usage at all.
3434

3535
- **`Ctrl+C` while the slash-command popup is open dismisses the popup.** It used to fall through to the outer handler and quit the session, which surprised users who only wanted to bail out of the suggestion list. Ctrl+C with the popup closed still requests shutdown.
36-
- **The cursor shape now follows the active mode after `/safe` and `/normal`.** Toggling safe mode mid-session previously updated the status line but left the cursor in its old shape; the cursor now switches to the safe-mode underscore on `/safe` and back to the default block on `/normal`, matching the startup behaviour.
36+
- **The input cursor now follows the active mode after `/safe` and `/normal`.** Safe mode draws the cursor as a yellow underline inside the input box (matching the yellow `safe` status indicator); normal mode keeps the default reversed block. Toggling mid-session updates the cursor immediately, matching the startup behaviour.
3737
- **A panic anywhere inside the TUI now restores the terminal before the backtrace prints.** A process-wide panic hook disables raw mode, disables bracketed paste, pops the keyboard enhancement flags, and shows the cursor through a real-tty handle that bypasses the output-capture pipe — so even a panic that strikes before the local Drop chain runs leaves the user with a usable shell.
3838
- **Quitting while a confirmation modal is on screen no longer hangs the worker.** The event loop now sends the modal's default answer back before tearing down, unblocking the worker thread that was parked waiting for a reply so the `join` on shutdown completes promptly.
3939
- **Tool output without newlines no longer freezes the UI.** A captured pipe that delivered a multi-kilobyte blob with no `\n` used to keep the reader thread waiting silently; sofos now flushes the partial line to the UI every 4 KB and continues reading.

src/repl/tui/ui.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ fn draw_input(frame: &mut Frame, area: Rect, app: &App) {
195195
}
196196
let title = Line::from(title_spans);
197197

198+
// Yellow underline in safe mode, default reversed block otherwise.
199+
if safe {
200+
textarea.set_cursor_style(
201+
Style::default()
202+
.fg(SAFE_MODE_FG)
203+
.add_modifier(Modifier::UNDERLINED),
204+
);
205+
} else {
206+
textarea.set_cursor_style(Style::default().add_modifier(Modifier::REVERSED));
207+
}
198208
textarea.set_block(
199209
Block::default()
200210
.borders(Borders::ALL)

0 commit comments

Comments
 (0)