Skip to content

Instantly share code, notes, and snippets.

@vinhnx
Forked from jamesgecko/config
Created March 11, 2026 06:30
Show Gist options
  • Select an option

  • Save vinhnx/0de909c1b0a0dc2de7b5a73e0ebf495a to your computer and use it in GitHub Desktop.

Select an option

Save vinhnx/0de909c1b0a0dc2de7b5a73e0ebf495a 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);
}
@gajus

gajus commented Aug 30, 2026

Copy link
Copy Markdown

This should be a configurable feature. Very useful. Thank you!

@vinhnx

vinhnx commented Aug 31, 2026

Copy link
Copy Markdown
Author

This should be a configurable feature. Very useful. Thank you!

No problems, I'm glad you find it useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment