Created
March 9, 2026 20:09
-
-
Save jamesgecko/dd921cef7db3b9533cee4473e832f2a4 to your computer and use it in GitHub Desktop.
Ghostty - Add a focus rectangle around the active pane
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unfocused-split-opacity = 1 | |
| custom-shader=~/.config/ghostty/focus-pane.glsl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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