fix: reset cursor to column 0 after raw-mode sub-prompts#22
Open
nelopuchades wants to merge 2 commits into
Open
fix: reset cursor to column 0 after raw-mode sub-prompts#22nelopuchades wants to merge 2 commits into
nelopuchades wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/backend,/model, filters,y/Nconfirms,and every other
plain_read_linecaller) emitted a bare\non Enter — andon Ctrl+C/Ctrl+D — while the terminal was still in raw mode.
\nis a line feed only: the cursor drops one row but stays inthe input's last column, so the first line the command printed afterwards
(the
✓confirmation, a picker's first row) began far to the right.\r\ninstead so the cursor returns to column 0 before the caller prints.visible in submenus that print several lines right after a selection.
Test plan
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test(input module + full suite pass)Screenshots
Before
After