GeezerVison is showing github.com — fix(activity): highlight Windows commands with the right shell grammar by gero3 · Pull Request #40470 · pingdotgg/t3code
Conversation
Problem
The activity log uses Unix shell highlighting for lowercase PowerShell cmdlets and CMD commands. For example, it treats the percent-delimited environment variable in a CMD script as ordinary quoted text.
- On Windows, have an agent run
get-childitem -Force and cmd.exe /c "echo %TEMP% & dir" as separate shell calls.
- Expand the activity group and each command. The command details should use PowerShell and Batch highlighting, respectively.
Change
Match selected common cmdlets by full name regardless of case and keep the existing title-case recognition. Select the built-in Batch grammar for explicit CMD invocations and recognizable batch syntax. Web and desktop use the shared classifier, and mobile accepts its Batch result through the existing native lexer. The original command text stays available for selection and copying.
Scope
This fixes one syntax-highlighting bug on already-supported shells. The two short reproductions show the bug directly, so a separate issue is unnecessary.
Verification
- Against
origin/main at dd941b9c3b, 11 of the 23 shared grammar cases failed. All 23 passed with the patch.
- In a local Windows web work log with a seeded fixture, both Windows commands rendered with the expected grammar and their exact command text was selectable. The screenshots below capture the same web command renderer in dark mode with identical inputs, including the GNU install-info command whose name resembles a cmdlet.
- Mobile's WASM-backed test harness produced the expected PowerShell and Batch tokens and preserved the sample text. Native device access was unavailable.
- 132 focused tests and 2 web browser tests passed.
vp run check:changed origin/main also passed, including type checks for seven affected packages.
Before and after


Model: GPT-6.2 Sol. Harness: Codex in T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Command language detection now returns PowerShell, Batch, or shell-script. The mobile highlight function uses the shared language type, and tests cover language selection for command examples.
Changes: Command highlighting
| Layer / File(s) |
Summary |
Command language classification and tests packages/client-runtime/src/work-log/commandLabel.ts, packages/client-runtime/src/work-log/commandLabel.test.ts |
commandHighlightLanguage now recognizes PowerShell, Batch, and shell-script commands. PowerShell detection includes additional cmdlets and call-operator syntax. Tests cover language selection across command examples. |
Mobile highlight language type apps/mobile/src/lib/highlights.ts |
highlightCommand now uses the shared CommandHighlightLanguage type. Its implementation is unchanged. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#15037: Selects command display grammars based on executable names, which overlaps with this change’s command-to-language selection.
Suggested reviewers: juliusmarminge, yash-singh1, macroscopeapp
Merge Risk: Minimal · up to e2751
-
This change improves syntax highlighting for Windows PowerShell and CMD commands in the activity log. No actionable merge-blocking risk was found, and the original command text is unchanged.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "fix(activity): highlight Windows commands with the right shell grammar" matches the main change: the classifier now picks PowerShell or Batch grammar for Windows commands instead of Unix sh… |
| Description check |
 |
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, plus before/after screenshots and a model/harness line. The Problem section gives reproductio… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title "fix(activity): highlight Windows commands with the right shell grammar" matches the main change: the classifier now picks PowerShell or Batch grammar for Windows commands instead of Unix shell highlighting. It is specific and follows the conventional commit style the repository template asks for. The title is 70 characters, which is within a typical length limit.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, plus before/after screenshots and a model/harness line. The Problem section gives reproduction steps. The Change section explains the classifier and mobile handling. The Scope section explains why no separate issue is needed. The Verification section gives focused test counts and a manual web check, and it states that native mobile device access was unavailable. The template's optional comment about evidence upload is satisfied by the embedded GitHub-hosted images. The description is mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 1cedd4b and e27514f.
Files selected for processing: 3
-
apps/mobile/src/lib/highlights.ts
packages/client-runtime/src/work-log/commandLabel.test.ts
packages/client-runtime/src/work-log/commandLabel.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|