sync: global→pool, pool-guard raus, Session-Watcher-Setup, verbotenes Wort Ehrlich

This commit is contained in:
marcus.hinz
2026-07-04 19:09:13 +02:00
parent a7ff9378da
commit 79314d6140
43 changed files with 669 additions and 33 deletions
+15
View File
@@ -0,0 +1,15 @@
// ghostty-wincount <pid> Anzahl sichtbarer Normal-Fenster (Layer 0) des
// Prozesses, direkt vom Window-Server. Keine Apple-Events, kein TCC-Prompt.
import CoreGraphics
import Foundation
guard CommandLine.arguments.count == 2, let pid = Int32(CommandLine.arguments[1]) else {
FileHandle.standardError.write(Data("usage: ghostty-wincount <pid>\n".utf8))
exit(2)
}
let list = CGWindowListCopyWindowInfo([.optionOnScreenOnly], kCGNullWindowID) as? [[String: Any]] ?? []
let n = list.filter {
($0[kCGWindowOwnerPID as String] as? Int32) == pid &&
($0[kCGWindowLayer as String] as? Int) == 0
}.count
print(n)