sync: global→pool, pool-guard raus, Session-Watcher-Setup, verbotenes Wort Ehrlich
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user