Skip to content

Give sight console its own terminal colors instead of copying the editor's - #452

Merged
jbearak merged 4 commits into
mainfrom
t3/console-terminal-palette
Nov 26, 2026
Merged

jbearak merged 4 commits into
mainfrom
t3/console-terminal-palette

Conversation

@jbearak

@jbearak jbearak commented Nov 26, 2026

Copy link
Copy Markdown
Owner

#450 matched sight console's input colors to VS Code's Dark+/Light+ editor colors. That match can't hold: the console runs in any terminal, and even in VS Code's Stata pane the terminal's 16 colors come from the terminal palette, not the editor theme. Testing in real terminals also showed the #450 colors, and some original ones, reading badly. Light-theme yellow strings were low-contrast, and plain blue nearly disappears on dark xterm and Windows-console palettes.

This PR gives the console a palette chosen for terminals. It keeps #450's work on control words (if, else, foreach in command position, and } else).

Token Original #450 Now
command bold blue bold blue bold blue
prefixes, control words, if/in blue magenta (in blue) magenta
string green yellow green (same as Raven's console)
number cyan green default color
macro magenta cyan cyan
comment dim dim green dim
  • Numbers are left uncolored so blue appears only in bold commands. Plain blue (#0000ee on black in xterm) was close to invisible. That's also why the old blue quietly/if/in changed to magenta.
  • Comments stay dim rather than bright black, because Solarized Dark sets bright black to its background color and the comments disappeared.

Proof:

  • Recorded one real StataMP 18 session through sight console on macOS, with typed commands, a do-file echo, a collinearity note: and errors, under each of the three palettes.
  • Played those recordings through xterm.js (VS Code's terminal renderer) using the VS Code dark/light, macOS Terminal Basic and Solarized Dark palettes.
  • Screenshotted real xterm windows in a Linux VM (Lima/Ubuntu) in dark and light, both replaying the Stata session and running the console live.
  • Line endings, typecheck, lint, bun test ./tests and the PTY integration tests pass.

Reviewed with sol-loop: 1 round with gpt-6.2-sol. Sol verdict: approved. Design input from gpt-6.2-astra.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 76 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 960afeae-776e-4c5f-b3b5-f62c3feb4f08
Commits

Reviewing files that changed from the base of the PR and between 1c237d2 and b9061b9.

Files selected for processing: 4

  • docs/console.md
  • src/console/highlighter.ts
  • tests/integration/console/console-pty.test.ts
  • tests/unit/console/text-processing.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@jbearak
jbearak merged commit 96d3980 into main Nov 26, 2026
17 checks passed
@jbearak
jbearak deleted the t3/console-terminal-palette branch November 26, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant