Repository navigation
feat(theme): selected text colour as a theme field - #616
Merged
Merged
Conversation
A theme could set the selection background but not the colour of the text inside it, so selected text always kept its own colours. Themes now take an optional selectionForeground, passed to xterm with the rest of the terminal palette. Leaving it unset keeps today's behaviour, so existing themes and the built-in presets are unchanged. The theme creator shows it as "Selected Text" under Terminal Base. An unset field shows an empty swatch; once a colour is picked the row gets a reset button. The colour sent to tmux for copy mode follows the field too. The creator's UI and terminal colour rows were two copies of the same markup. They now share one row component and one icon button. Refs #317
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.
Refs #317
Problem
A theme can set the selection background but not the colour of the text inside it. Selected text always keeps its own colours, so a theme cannot reproduce the Termius Dark look from the issue (selected text turns green).
Change
TerminalThemetakes an optionalselectionForeground. It goes to xterm with the rest of the terminal palette. Unset keeps today's behaviour, so existing themes and the built-in presets are unchanged.terminalColorsForuses the field forselectionFg, so tmux copy mode follows it. An unparseable value falls back to the foreground.ColorRowandRowIconButton.Testing
tsc --noEmitclean, related vitest suites pass (43 tests, 2 new interminalColors.test.ts).Not covered