Fixes#10935
This is a more robust way to detect "is my surface focused" because that
question usually means "is my surface the last focused surface" if a
_different_ surface is not focused. We already have used this pattern
all over but we should extend it to SwiftUI too.
**Summary:**
- Add tint overlay to dim terminal windows when inactive, fixes
https://github.com/ghostty-org/ghostty/discussions/10040
- Refactor the liquid glass effect into a dedicated `TerminalGlassView`
class
Note: The tint overlay color and opacity values may not be ideal —
feedback is welcome.
**AI Disclosure:** I used Claude Code to read the macos repo and
understand the liquid glass implementation. Implemented basic tint
overlay mainly by hand. Refactor the code and review changes with Claude
Code.
## Summary
Cmd-clicking a file path containing `~` (e.g. `~/Documents/file.txt`)
fails to open the file on macOS because `URL(filePath:)` treats `~` as a
literal directory name rather than the user's home directory.
This uses `NSString.expandingTildeInPath` to resolve `~` before
constructing the file URL.
## Root Cause
In `openURL()`, when the URL string has no scheme it falls through to:
```swift
url = URL(filePath: action.url)
```
Swift's `URL(filePath:)` does not perform tilde expansion. A path like
`~/Documents/file.txt` produces a URL pointing to a non-existent file,
and `NSWorkspace.open` silently fails.
## Fix
```swift
let expandedPath = NSString(string: action.url).expandingTildeInPath
url = URL(filePath: expandedPath)
```
## Reproduction
1. Have a terminal application (e.g. Claude Code) that outputs file
paths with `~` prefixes
2. Cmd-click the path in Ghostty on macOS
3. The file does not open (fails silently)
With this fix, the path resolves correctly and opens in the default
editor.
`URL(filePath:)` treats `~` as a literal directory name, so
cmd-clicking a path like `~/Documents/file.txt` would fail to
open because the resulting file URL doesn't point to a real file.
Use `NSString.expandingTildeInPath` to resolve `~` to the user's
home directory before constructing the file URL.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This rule is generally trying to be helpful, but it doesn't like a few
places in our code base where we're intentionally listing out all of the
well-known cases. Given that, just disable it.
https://realm.github.io/SwiftLint/no_fallthrough_only.html
Addresses discussion in #3729 and issues relating to #7333, #9590, and
#9617.
Rendering the Secure Keyboard Input overlay using innerShadow() can
strain the resources of the main thread, leading to elevated CPU load
and in some cases extended disruptions to the main thread's
DispatchQueue that result in lag or frozen frames. This change achieves
the same animated visual effect with ~35% lower CPU usage and resolves
most or all of the terminal rendering issues associated with the
overlay.
This rule is generally trying to be helpful, but it doesn't like a few
places in our code base where we're intentionally listing out all of the
well-known cases. Given that, just disable it.
https://realm.github.io/SwiftLint/no_fallthrough_only.html