fix(terminal): name the selection colour the way xterm 6 does - #423
Merged
Merged
Conversation
Every per-skin xterm palette declared its selection layer as `selection`, the key xterm.js renamed to `selectionBackground` in v5. An ITheme is a plain object handed straight to the terminal, so an unknown key is not an error, it is dropped: all seven skins have been drawing xterm's built-in default, rgba(255,255,255,0.3), rather than the colour sitting next to it in the palette. Nobody saw it on the dark skins, where white at 30% is close to what those palettes asked for. On the four light skins it is white over a near-white background: blended, Paper Gray's selection differs from its own background by 3/255. That is not a subtle highlight, it is no highlight, and it looks exactly like a selection gesture that failed, which is part of what #360 reports on Android Chrome. test/skin-themes.test.ts pins both halves: the key name, and that the blended selection stays at least 16/255 from the background on every skin, plus the light-skin fallback landing under that floor, which is what makes this a fix rather than a rename. Refs #360 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Merged, and shipping in 1.29.0: https://github.com/Ark0N/Codeman/releases/tag/codeman@1.29.0. Worth noting that #375 carried the same rename as one of its 27 commits ( |
This was referenced Sep 14, 2026
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.
Part of #360, and the part that is demonstrable without an Android device.
The bug
Every per-skin xterm palette in
terminal-ui.jsdeclared its selection layer asselection. xterm.js renamed that key toselectionBackgroundin v5, and this repo is on@xterm/xterm ^6. AnIThemeis a plain object handed straight to the terminal, so an unknown key is not an error, it is dropped: all seven skins have been painting xterm's built-in default,rgba(255, 255, 255, 0.3), instead of the colour sitting next to it in the palette.On the dark skins nobody noticed, because white at 30% is roughly what those palettes asked for anyway. On the four light skins it is white over a near-white background. Blended the way xterm does it (
selectionBackgroundOpaque = blend(background, selection)):#f6f8fa#f9fafc#c7dbf4#fdf6e3#fef9eb#d2e1e0#eff1f5#f4f5f8#c9d8f5#faf4ed#fcf7f2#d0d8d8A three-to-eight-in-255 highlight is not a subtle highlight, it is no highlight, and it is indistinguishable from a selection gesture that failed. That is one of the things #360 describes on Android Chrome, and it applies to desktop drag-select on those skins too.
The fix
Rename the key in all seven palettes. Nothing reads
.selectionanywhere in the codebase (the theme object is passed wholesale to xterm byapplyTerminalSkin()and by the teammate terminals inpanels-ui.js), so the rename is the whole change.test/skin-themes.test.tspins both halves, because a rename that fixed nothing would pass a name-only assertion:selection:key, and every palette declaresselectionBackground;Verified failing on master and passing here.
What this does not fix
The main symptom in #360, the terminal going blank on long-press on Android Chrome, is separate and is not addressed here. I have asked on the issue for the one diagnostic that would narrow it (whether
?nowebglchanges the behaviour), since a blanked viewport under WebGL points somewhere quite different from a lost selection.