-
-
Save vinhnx/0de909c1b0a0dc2de7b5a73e0ebf495a 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