feat: command history navigation with up/down arrow keys

CommandLine now records every submitted command in a recall list (up to
50 entries).  Pressing ↑ in the command input walks back through the
list, ↓ moves forward, and returning to the newest position restores
the draft text the user had typed before navigating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-07 00:04:12 +03:00
commit 80ca095121
4 changed files with 76 additions and 1 deletions

View file

@ -176,6 +176,10 @@ pub enum Message {
CommandInput(String),
CommandSubmit,
Command(String),
/// Recall previous command in history (↑ arrow key).
CommandHistoryPrev,
/// Recall next command in history (↓ arrow key).
CommandHistoryNext,
ToggleLayers,
LayerToggleVisible(usize),
LayerToggleLock(usize),