Skip to content

Conversation

@benodiwal
Copy link
Contributor

@benodiwal benodiwal commented Nov 9, 2025

Add new shader uniforms to provide access to terminal color scheme:

  • iPalette[256]: 256-color ANSI palette array
  • iBackgroundColor: terminal background color
  • iForegroundColor: terminal foreground color
  • iCursorColor: pure cursor color (without opacity)

The new iCursorColor uniform provides the unmodified cursor color
from the colorscheme, while existing iCurrentCursorColor retains
the opacity-modified version. This enables shader authors to create
sophisticated theme-aware effects and replace cursors entirely.

Color uniforms are populated per-frame when terminal colors change,
including dynamic updates via OSC sequences. All uniforms use
normalized float values (0.0-1.0) with RGB components.

The tests in this PR were written primarily by Claude Code.

Fixes #9417

@benodiwal benodiwal marked this pull request as ready for review November 9, 2025 07:22
@benodiwal benodiwal requested a review from a team as a code owner November 9, 2025 07:22
@qwerasd205
Copy link
Member

qwerasd205 commented Nov 9, 2025

Is this PR AI-assisted? It's okay if it is, we just ask that you disclose that fact if so. (See CONTRIBUTING.md.)

@benodiwal
Copy link
Contributor Author

Tests are written by agent. Let me disclose this in description. Thanks for pointing out.

@ClearAspect
Copy link
Contributor

ClearAspect commented Nov 13, 2025

Should we really be trying to update the palette every single frame for this? Maybe this would be better to do on a config reload or an OSC sequence? I suppose bg_color is updated every frame so maybe this isn't actually such a big deal.

Still seems kind of wasteful. Maybe some way of marking the colors as dirty would be a better approach

@ClearAspect
Copy link
Contributor

#9656

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.

custom shader: add color scheme information to uniforms

3 participants