Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
Created March 9, 2026 20:09
Show Gist options
  • Select an option

  • Save jamesgecko/dd921cef7db3b9533cee4473e832f2a4 to your computer and use it in GitHub Desktop.

Select an option

Save jamesgecko/dd921cef7db3b9533cee4473e832f2a4 to your computer and use it in GitHub Desktop.
Ghostty - Add a focus rectangle around the active pane
unfocused-split-opacity = 1
custom-shader=~/.config/ghostty/focus-pane.glsl
// Shows border on focused pane
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
// Sample the terminal content
vec4 terminal = texture2D(iChannel0, uv);
vec3 color = terminal.rgb;
if (iFocus > 0) {
// FOCUSED: Add border
float borderSize = 2.0;
vec2 pixelCoord = fragCoord;
bool isBorder = pixelCoord.x < borderSize ||
pixelCoord.x > iResolution.x - borderSize ||
pixelCoord.y < borderSize ||
pixelCoord.y > iResolution.y - borderSize;
if (isBorder) {
// macOS-selection-blue border
color = vec3(0, 0.35, 0.74) * 1.0;
}
}
fragColor = vec4(color, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment