Repository navigation
feat: surface terminal error responses via TermResponse on Neovim >= 0.12 - #56
Open
hisanari-dev wants to merge 1 commit into
Open
hisanari-dev wants to merge 1 commit into
hisanari-dev wants to merge 1 commit into
Conversation
…0.12 Transmits now carry q=1 (suppress OK, keep errors) when Neovim can deliver APC responses through TermResponse (0.12+). renderer.lua records error responses for ids it owns in a bounded list, and :checkhealth blit lists them. Neovim 0.10 / 0.11 keep q=2 and register no listener, so their behavior is unchanged. Responses are diagnostic only: they arrive after show() has returned and no recovery path reacts to them. Closes #12
There was a problem hiding this comment.
This PR successfully implements terminal error response handling for Neovim 0.12+. The implementation is well-architected with proper feature detection, bounded error storage (20 most recent errors), and comprehensive test coverage. The code correctly uses q=1 (suppress OK, keep errors) when TermResponse support is available, and falls back to q=2 (suppress all) for earlier Neovim versions. All changes are working correctly and ready to merge.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
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.
📦 Pull Request
Description
Surfaces kitty graphics protocol error responses (e.g. a PNG the terminal rejected) instead of suppressing them unconditionally.
TermResponseevent, which delivers APC responses from Neovim 0.12 onward. The feature is therefore feature-detected (terminal.has_response_support()); the minimum supported version stays 0.10.q=1(suppressOK, keep errors).renderer.luaadds oneTermResponseautocmd to the handle-gatedblitaugroup, parses each sequence with the new pureterminal.parse_response(), and records errors for ids it owns in a bounded list (most recent 20).:checkhealth blitlists them;renderer.response_errors()returns a copy.q=2and no listener is registered — behavior is unchanged.show()has returned, so they cannot become anil, errreturn value, and no recovery path (Ghostty retransmit, delete retries) reacts to them.docs/spec/kitty-graphics.mdsaidq=2is set "always", but placement (a=p) and delete (a=d) commands have never carried aqkey. The memo now says so; those bytes are unchanged in this PR. As a side effect, placement error responses are recorded on 0.12+ too.Not verified in this PR: behavior against a real terminal. The unit tests deliver synthetic
TermResponseevents; the sequence shape was taken from Neovim 0.12.5'stui/input.c. Two steps were added todocs/manual-testing.md(no stray input after normal use; a corrupt PNG shows up in:checkhealth blit) and still need to be run on kitty, WezTerm, and Ghostty.Related Issue
Closes #12
Type of Change
Checklist
makelocally (stylua --check,selene, tests) and it passes.docs/spec/memo if protocol or terminal-detection behavior changed.doc/blit.txtand/or README if this changes the public API.feat:,fix:, etc.).