Repository navigation
Conversation
On a terminal that isn't trusted to deliver bracketed paste, the raw-paste guard holds each plain character for a few milliseconds and, when nothing follows, types it into the composer. That happens before the event loop's Normal-mode arm sees the key, so with vim mode on, i, x, dd and the motions went into the draft as text until the session's first bracketed paste. A held character now goes to the Normal-mode keys when no completion menu is open, the condition that arm checks; it is absorbed in Visual mode, as the arm after it does, and typed otherwise. Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 28, 2026
This branch has not been deployed
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.
What and why
With
composer_vim_mode = "vim", Normal-mode keys type into the draft on any terminal thatpaste.rsdoesn't trust to deliver bracketed paste: every Windows terminal, and anything whoseTERM_PROGRAMis unset or isn't ghostty, iTerm.app, WezTerm or Apple_Terminal (tmux and VS Code's terminal set their own). There, the raw-paste guard holds each plain ASCII character for 8 ms to see whether a paste follows, and when nothing does,flush_paste_burst_before_composerinserts it. That happens before the event loop's Normal-mode arm sees the key, soi,x,ddand the motions all go into the draft as text, and Esc then clears the composer. The keys only start working after the session's first bracketed paste.Launch composer,
TERM_PROGRAMunset, one key at a time, before:After:
A held character now goes to
vim_mode::handle_vim_normal_keywhen no slash or mention menu is open, the condition that arm checks; it is absorbed in Visual mode, as the arm after it does; and it is typed into the composer otherwise. The function already does this for a held Space, which goes to the transcript when the composer is empty. A burst is still a paste:abcsent in one write lands in the draft as text in Normal mode, before and after.Issue
No-Issue: vim Normal-mode keys are typed as text on a terminal without trusted bracketed paste; I searched and found no issue for it
How I tested it
mainat b8afed5 in a pseudo-terminal with an empty HOME andcomposer_vim_mode = "vim"insettings.toml, sending one key at a time on the launch composer. WithTERM_PROGRAMunset, the results are above;vthenqtypedvqbefore and does nothing now. WithTERM_PROGRAM=iTerm.appthe two builds give the same results, and the steps before theabcburst match what this change now gives with it unset; the burst itself differs, since a trusted terminal reads it as typed keys rather than a paste./he, Esc,xreads/hxewith this change, as it does with iTerm.app, because the slash menu is open.cargo nextest run -p codewhale-tui --lib: 13908 of 13912 passed, with the 260paste,vim,composerandevent_looptests among them. The 4 failures are plugin import tests (three inplugins_dsh_tests, plusplugins_skill_tests::dsh_packages_import_through_the_reviewed_install_and_update_flow, all "composition reviewer is unavailable"); the same 4 fail onmainat b8afed5 without this change.cargo fmt --all -- --check,cargo clippy -p codewhale-tui --all-targets --all-featureswith CI's flags (also on 1.99),cargo check -p codewhale-tui --all-targetsandcargo +1.89.0 check -p codewhale-tui: clean.Checklist
maincargo fmt --allpasses, and tests cover new or changed behaviordocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it) — n/a