Repository navigation
fix: unstick keys after rejecting a question prompt - #73
Merged
oribarilan merged 2 commits intoSep 11, 2026
Merged
Conversation
## Why vimcode tracks pending prompts via api.event so it can pass keys through while an overlay owns the keyboard. It subscribed to question.asked (+1) and question.replied (-1) only — not question.rejected, which the host emits when a question prompt is dismissed. The +1 never balanced, so hasActivePrompts() stayed true and the key intercept returned early without consuming any key. Every key, including Escape, went to the host while syncCursorStyle() kept painting the block cursor. ## How Subscribe to question.rejected and apply the same -1 as question.replied, disposing it alongside the other listeners. ## Tests Integration test drives plugin.tui with mock event handlers and asserts keys pass through while a question is pending and are consumed again after question.rejected. Also covers question.replied, permission.replied, and child-to-root resolution. bun test green (313 tests). Fixes oribarilan#72
Owner
|
@BeyramTaglietti thanks for taking the time to report the issue, troubleshoot and fix it. this is awesome |
Contributor
Author
|
@oribarilan my pleasure to help |
oribarilan
added a commit
that referenced
this pull request
Sep 11, 2026
## Release v0.18.1 Patch release containing the question-dismissal fix from #73 and documentation updates from #74. ### Fixed - Fixed Vim keys remaining unresponsive after dismissing or rejecting a question prompt (#72). ### Changed - Updated the documented cache-installed mode indicator limitation with the latest OpenCode and OpenTUI findings (#3). ### Release preparation - Updated package.json, src/version.ts, both README version pins, and changelog comparison links per CONTRIBUTING.md. - just check passed: 313 tests, zero lint warnings or errors. - Version consistency and git diff --check passed. After CI passes, this PR must be squash-merged before tagging v0.18.1 and publishing the GitHub release.
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
Rejecting or dismissing a question prompt no longer leaves vimcode passing every key through to the editor (block cursor, typing works, Escape dead).
Why
vimcode tracks pending prompts via
api.eventso it can step aside while an overlay owns the keyboard. It subscribed toquestion.asked(+1) andquestion.replied(-1) only — notquestion.rejected, which the host emits when a question prompt is dismissed. The +1 never balanced, sohasActivePrompts()stayed true and the key intercept returned early without consuming any key. Every key, including Escape, went to the host whilesyncCursorStyle()kept painting the block cursor.How
Subscribe to
question.rejectedand apply the same -1 asquestion.replied, disposing it alongside the other listeners.Tests
plugin.tuiwith mock event handlers and asserts keys pass through while a question is pending and are consumed again afterquestion.rejected. Also coversquestion.replied,permission.replied, and child→root resolution.bun testgreen (313 tests).Fixes #72