Repository navigation
Report terminal color scheme via CSI 996 and Mode 2031 - #657
Closed
ayanamists wants to merge 3 commits into
Closed
ayanamists wants to merge 3 commits into
ayanamists wants to merge 3 commits into
Conversation
ghostel stored DEC Mode 2031 but never implemented color-scheme DSR: CSI ? 996 n was ignored, and theme changes did not emit CSI ? 997. Multiplexers such as herdr therefore kept a stale OSC 11 cache. Infer light/dark from the protocol background (same luma cutoff as herdr), answer 996 from that, and write an unsolicited 997 from ghostel--set-default-colors when 2031 is on.
Those are POSIX-only, so the CSI 996 child never printed READY on Windows.
Owner
|
@ayanamists thanks. I didn't make a release yet, so if you want to use this feature you have to build the native module yourself until a release is made. |
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.
Summary
? 996 nwith the terminal's dark/light color scheme.? 997after synchronized default colors change when Mode 2031 is enabled.ghostel-defaultbackground using Neovim's BT.601 midpoint convention.Why
libghostty already parses CSI 996 and tracks Mode 2031, but Ghostel did not provide the color-scheme callback or send change reports. Multiplexers could therefore keep stale host color caches after an Emacs theme change.
Ghostel does not store a separate light/dark appearance value. Its protocol background is seeded from the resolved
ghostel-defaultface, which users can customize independently from the rest of Emacs. CSI 996/997 therefore classify the most recently synchronized default background. Theme changes synchronize it through the existing hook; after changingghostel-defaultdirectly, users can callghostel-sync-theme.The implementation deliberately reads the default background rather than the current OSC 11 override. An OSC 11 override belongs to the child-controlled terminal session and should not redefine the host terminal's appearance.
The RGB classification follows the same BT.601 luma and 0.5 midpoint convention used by Neovim's terminal background detection.
Testing
zig build --prefix .zig build testgit diff --check