vte: guard case 'm' (SGR) against CSI_GT prefix#29
Merged
kdj0c merged 1 commit intokmscon:mainfrom Mar 12, 2026
Merged
Conversation
Fish 4.x (and other terminals using modifyOtherKeys/XTMODKEYS) send \033[>4;1m at every prompt to enable the keyboard protocol. The '>' prefix sets the CSI_GT flag, marking this as a private/DEC sequence — not an SGR attribute sequence. do_csi() dispatches case 'm': directly to csi_attribute() without checking CSI_GT, so \033[>4;1m is misinterpreted as SGR 4;1 (underline + bold). This causes blank terminal cells to render as '_'. The adjacent case 'p': already has the correct CSI_GT guard; apply the same pattern to case 'm':.
Contributor
Author
|
Tested with fish, those strange underlines are now gone! |
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.
Problem
Fish 4.x (and other terminals implementing modifyOtherKeys/XTMODKEYS) send
\033[>4;1mat every prompt to enable the keyboard protocol. The>prefix sets theCSI_GTflag, indicating this is a private/DEC sequence — not an SGR attribute.do_csi()dispatchescase 'm':directly tocsi_attribute()without checkingCSI_GT, so\033[>4;1mis misinterpreted as SGR 4;1 (underline + bold). The result: blank terminal cells render as_.This is reproducible with fish 4.x inside any kmscon/libtsm terminal.
Fix
Add the same
CSI_GTguard thatcase 'p':already has, one case below:References
\033[>4;1m(XTMODKEYS enable) at every readline re-entry, not just startupcase 'p':in the same switch already correctly guards againstCSI_GTCSI > Ps m— Set/reset key modifier options