Add code-token VisualRoles and Code view#5313
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
10 tasks
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/87c31cb1-c209-40bb-a480-6f3fbe9e8d55 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add code-token VisualRole vocabulary and unify markdown highlighter
Add code-token VisualRoles and Code view
May 15, 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.
Fixes
Adds theme-driven token roles for syntax-highlighted code so Markdown, the new
Codeview, and downstream editors can share the active Terminal.Gui theme palette.Proposed Changes/Todos
Code token roles
VisualRole.CodeCommentthroughCodeAttribute.Schemestorage, JSON round-trip support, and fallback:Code* → Code → Editable → Normal.Theme/config support
Base.Code*colors.Examples/Themes/code-dark.config.json.Rendering pipeline
TextMateSyntaxHighlighternow emitsStyledSegment.Role.VisualRole.Code*.Codeview:UICatalog
Tests
Coderendering.Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
accounts.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=7412 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.0Zz0qB --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18362738395879841708,9124006556522462828,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,3170967420076418732,10802322850313536385,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium chromium --headless --no-sandbox --disable-gpu --screenshot=/tmp/tg-ui/code-demo.png --window-size=1000,500 file:///tmp/tg-ui/code-demo.html(dns block)clients2.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=7412 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.0Zz0qB --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18362738395879841708,9124006556522462828,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,3170967420076418732,10802322850313536385,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium chromium --headless --no-sandbox --disable-gpu --screenshot=/tmp/tg-ui/code-demo.png --window-size=1000,500 file:///tmp/tg-ui/code-demo.html(dns block)redirector.gvt1.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=7412 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.0Zz0qB --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18362738395879841708,9124006556522462828,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,3170967420076418732,10802322850313536385,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium chromium --headless --no-sandbox --disable-gpu --screenshot=/tmp/tg-ui/code-demo.png --window-size=1000,500 file:///tmp/tg-ui/code-demo.html(dns block)www.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=7412 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.0Zz0qB --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18362738395879841708,9124006556522462828,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,3170967420076418732,10802322850313536385,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium chromium --headless --no-sandbox --disable-gpu --screenshot=/tmp/tg-ui/code-demo.png --window-size=1000,500 file:///tmp/tg-ui/code-demo.html(dns block)If you need me to access, download, or install something from one of these locations, you can either: