ghostty icon indicating copy to clipboard operation
ghostty copied to clipboard

custom shader: add color scheme information to uniforms

Open mitchellh opened this issue 2 months ago • 1 comments

// 256-color ANSI palette
uniform vec4 iPalette[256];          // palette 0-255

// Core terminal colors
uniform vec4 iBackgroundColor;      // background
uniform vec4 iForegroundColor;      // foreground
uniform vec4 iCursorColor;          // cursor-color

[!NOTE] iCursorColor already technically already exists as iCurrentCursorColor, but it behaves differently than I would expect. Currently, when using this uniform it includes the opacity from cursor-opacity baked in. This proposal adds iCursorColor as the pure, un-modified color from the colorscheme, giving shader authors both options. When using shaders to replace the cursor entirely (with cursor-opacity = 0.0), having access to the original color value is essential.

mitchellh avatar Oct 30 '25 20:10 mitchellh

Hi @mitchellh, I have raised a PR #9522 as a fix for this issue. Hope you give it a review. Thanks

benodiwal avatar Nov 09 '25 18:11 benodiwal