Skip to content

fix: reset cursor to column 0 after raw-mode sub-prompts#22

Open
nelopuchades wants to merge 2 commits into
GetSmallAI:mainfrom
nelopuchades:fix/raw-mode-cursor-reset
Open

fix: reset cursor to column 0 after raw-mode sub-prompts#22
nelopuchades wants to merge 2 commits into
GetSmallAI:mainfrom
nelopuchades:fix/raw-mode-cursor-reset

Conversation

@nelopuchades

Copy link
Copy Markdown
Contributor

Summary

  • Interactive sub-prompt readers (/backend, /model, filters, y/N confirms,
    and every other plain_read_line caller) emitted a bare \n on Enter — and
    on Ctrl+C/Ctrl+D — while the terminal was still in raw mode.
  • In raw mode \n is a line feed only: the cursor drops one row but stays in
    the input's last column, so the first line the command printed afterwards
    (the confirmation, a picker's first row) began far to the right.
  • Emit \r\n instead so the cursor returns to column 0 before the caller prints.
  • Pre-existing bug, not introduced by any recent feature; it was just more
    visible in submenus that print several lines right after a selection.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test (input module + full suite pass)

Screenshots

Before

image

After

image

nelopuchades and others added 2 commits July 16, 2026 09:26
Sub-prompt readers emitted a bare `\n` on Enter (and on Ctrl+C/Ctrl+D)
while still in raw mode, which line-feeds without a carriage return and
leaves the cursor in the input's last column. The first output printed
afterwards (e.g. the `✓` confirmation or a picker's first row) started at
that column, appearing shifted far to the right. Emit `\r\n` instead so
the next line begins at column 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Print a blank line between the option list and the "Select" prompt, and
another between the typed selection and the response line, so the picker
output no longer crowds together. Pairs with the raw-mode cursor reset so
the response lands aligned at column 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant