Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Find the shell completions an app links in, and take them with it
Țugui Dragoșfd92daa81450
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex fc87687c..ca24decc 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -131246,6 +131246,112 @@}}},+ "Shell Completion" : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Doplňování pro shell"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Shell-Vervollständigung"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Autocompletado de shell"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Complétion du shell"+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Completamento della shell"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "シェル補完"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "셸 자동 완성"+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Shell-aanvulling"+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Uzupełnianie powłoki"+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Autocompletar do Shell"+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Completare shell"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Автодополнение оболочки"+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Skalkomplettering"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kabuk Tamamlaması"+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Доповнення оболонки"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Shell补全脚本"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Shell補齊"+ }+ }+ }+ },"Shift-Command-Period in Finder does the same thing." : {"localizations" : {"cs" : {diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swiftindex fe7e6b6a..91d1682b 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift@@ -368,7 +368,7 @@ public struct LeftoverScanner: Sendable {matcher: LeftoverMatcher,bundle: String) -> LeftoverMatch? {- guard kind != .commandLineTools else { return leadsInside(bundle, link: url) }+ guard !kind.isForLinks else { return leadsInside(bundle, link: url) }guard kind != .nativeMessagingHosts else { return runsSomethingInside(bundle, manifest: url) }guard let inside = runsSomethingInside(bundle, job: url, kind: kind) else {return match(name, at: url, kind: kind, matcher: matcher)diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swiftindex 87a28221..34aa8728 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift@@ -41,6 +41,9 @@ public struct SearchLocation: Sendable, Hashable {/// `/usr/local/bin` and `/usr/local/sbin`, where an app links the command line tools it carries. Only a/// link into the app counts as the app's: a tool is named for what it does (`docker`), not for its maker.case commandLineTools+ /// The folders an app's installer links the shell completions of its tools into, for zsh, fish, bash, and+ /// PowerShell, as a Homebrew cask does. As for a tool, only a link into the app counts as the app's.+ case shellCompletions/// The folders where a browser looks for the manifests of the programs its extensions may run. A manifest/// is named for its host, not for the app, so only one whose program is inside the app counts as the app's.case nativeMessagingHosts@@ -49,6 +52,12 @@ public struct SearchLocation: Sendable, Hashable {case safariWebApps/// Somewhere no scan looks, which only a Homebrew cask can name: `~/Documents/Foo`, `/usr/local/etc/foo`.case elsewhere++ /// True for the folders where an item is named for what it does, a tool or its completion, so only a link+ /// that leads into an app says whose it is.+ public var isForLinks: Bool {+ self == .commandLineTools || self == .shellCompletions+ }}public let kind: Kind@@ -208,6 +217,11 @@ public struct SearchEnvironment: Sendable {locations += ["usr/local/bin", "usr/local/sbin", "opt/homebrew/bin"].map {SearchLocation(kind: .commandLineTools, url: rootDirectory.appending(path: $0, directoryHint: .isDirectory))}+ locations += ["usr/local", "opt/homebrew"].flatMap { prefix in+ PrivilegedPathPolicy.shellCompletionFolders.map { prefix + "/" + $0 }+ }.map {+ SearchLocation(kind: .shellCompletions, url: rootDirectory.appending(path: $0, directoryHint: .isDirectory))+ }let hosts = [(userLibrary, Self.nativeMessagingHosts.user), (localLibrary, Self.nativeMessagingHosts.local)]locations += hosts.flatMap { library, folders infolders.map { library.appending(path: $0, directoryHint: .isDirectory) }diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swiftindex 75f2363a..28b86ef3 100644--- a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift@@ -65,7 +65,7 @@ public struct OrphanConfidence: Sendable, Hashable {return OrphanConfidence(level: .unsure, reasons: [.running])}// Links into an app that is gone lead nowhere, whatever their dates or the maker's other apps suggest.- if group.items.allSatisfy({ $0.kind == .commandLineTools }) {+ if group.items.allSatisfy(\.kind.isForLinks) {return OrphanConfidence(level: .certain, reasons: [.leadsIntoAnAppThatIsGone])}if let app = group.rememberedApp, group.items.allSatisfy({ $0.namedAfter != nil }) {diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swiftindex 557e263d..183c522d 100644--- a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift@@ -297,7 +297,7 @@ public struct OrphanScanner: Sendable {goneBundles: [String: String] = [:],cameWithOneOf goneApps: [String]? = nil) async -> String? {- if kind == .commandLineTools {+ if kind.isForLinks {guard let bundle = goneApp(behind: url) else { return nil }return goneBundles[PathPattern.comparablePath(of: bundle)]?? bundle.deletingPathExtension().lastPathComponentdiff --git a/Packages/PeelCore/Sources/PeelCore/Removal/AppReset.swift b/Packages/PeelCore/Sources/PeelCore/Removal/AppReset.swiftindex f443798c..8fd41e2f 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/AppReset.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/AppReset.swift@@ -97,7 +97,8 @@ public struct AppReset: Sendable {// plug-in or a framework is code that macOS loads, not a setting.case .launchAgents, .launchDaemons, .privilegedHelperTools, .startupItems, .plugIns, .frameworks, .receipts,.library,- .sharedFolder, .hiddenHomeFiles, .homeFolder, .commandLineTools, .nativeMessagingHosts, .elsewhere:+ .sharedFolder, .hiddenHomeFiles, .homeFolder, .commandLineTools, .shellCompletions, .nativeMessagingHosts,+ .elsewhere:nil}}diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/HelperReach.swift b/Packages/PeelCore/Sources/PeelCore/Removal/HelperReach.swiftindex b1ccf90e..0a584b3c 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/HelperReach.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/HelperReach.swift@@ -18,15 +18,15 @@ struct HelperReach: Sendable {)}- /// True for an item in a folder command-line tools are linked into, which the helper takes only once the link- /// leads nowhere.+ /// True for an item in a folder command-line tools or their shell completions are linked into, which the helper+ /// takes only once the link leads nowhere.func takesOnlyALink(at url: URL) -> Bool {policy.takesOnlyALink(at: url.path(percentEncoded: false))}/// True when the helper would refuse `url` for where it is: outside the folders it serves, in `/Applications`- /// without being an app, or in a folder command-line tools are linked into as anything but a link that leads- /// nowhere, or into `leaving`, which moves first. `RemovalGuard` judges what the item itself is.+ /// without being an app, or in a folder command-line tools or their completions are linked into as anything but+ /// a link that leads nowhere, or into `leaving`, which moves first. `RemovalGuard` judges what the item itself is.func isBeyond(_ url: URL, leaving: URL? = nil) -> Bool {let path = url.path(percentEncoded: false)if let refusal = policy.refusal(of: path) {diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swift b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swiftindex 71786aff..f2a657b5 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swift@@ -45,8 +45,9 @@ struct RemovalGuard: Sendable {/// Nothing inside these may be removed. `/Library/Updates` is where Software Update stages macOS updates./// Lower-cased, because the spellings they are compared against are.private static let protectedPrefixes = ["/system", "/usr", "/bin", "/sbin", "/library/updates"]- /// The folders command-line tools are linked into. A link directly in one is the one thing under `/usr` that may- /// go: what an app's tool leaves there, which Peel's helper takes only once it leads nowhere.+ /// The folders command-line tools and their shell completions are linked into. A link directly in one is the one+ /// thing under `/usr` that may go: what an app's tool leaves there, which Peel's helper takes only once it leads+ /// nowhere.private static let toolLinkFolders = PrivilegedPathPolicy.linkLocations.map { PathComponents.of($0.lowercased()) }private let protectedPaths: Set<String>@@ -105,7 +106,7 @@ struct RemovalGuard: Sendable {refusal(of: destination, isALink: Self.isALink(trashed.path(percentEncoded: false)))}- /// True for the lower-cased spelling of a link directly in a folder command-line tools are linked into.+ /// True for the lower-cased spelling of a link directly in a folder tools or their completions are linked into.static func isAToolsLink(_ spelling: String, isALink: Bool) -> Bool {isALink && toolLinkFolders.contains(Array(PathComponents.of(spelling).dropLast()))}diff --git a/Packages/PeelCore/Sources/PeelPrivileged/HelperInterface.swift b/Packages/PeelCore/Sources/PeelPrivileged/HelperInterface.swiftindex 10ccab43..135976d9 100644--- a/Packages/PeelCore/Sources/PeelPrivileged/HelperInterface.swift+++ b/Packages/PeelCore/Sources/PeelPrivileged/HelperInterface.swift@@ -7,7 +7,7 @@ public enum HelperIdentity {public static let launchdPlistName = "com.tuguidragos.Peel.Helper.plist"/// Raise it whenever the helper changes, so Peel asks for the helper to be installed again rather than work with/// an older one. The helper refuses requests that carry any other version.- public static let protocolVersion = 10+ public static let protocolVersion = 11}/// The complete set of privileged operations. The helper validates every argument itself.diff --git a/Packages/PeelCore/Sources/PeelPrivileged/PrivilegedPathPolicy.swift b/Packages/PeelCore/Sources/PeelPrivileged/PrivilegedPathPolicy.swiftindex 41253a25..560c1ea3 100644--- a/Packages/PeelCore/Sources/PeelPrivileged/PrivilegedPathPolicy.swift+++ b/Packages/PeelCore/Sources/PeelPrivileged/PrivilegedPathPolicy.swift@@ -61,9 +61,16 @@ public struct PrivilegedPathPolicy: Sendable {"/private/var/db/receipts",]- /// The folders command-line tools are linked into. The helper takes only a link from them, and only one that- /// leads nowhere: what an app's tool leaves there once the app is gone.+ /// The folders command-line tools and their shell completions are linked into. The helper takes only a link from+ /// them, and only one that leads nowhere: what an app's tool leaves there once the app is gone.public static let linkLocations = ["/usr/local/bin", "/usr/local/sbin"]+ + shellCompletionFolders.map { "/usr/local/" + $0 }++ /// Where shell completions are linked under a prefix: Homebrew's four for a cask (`Cask::Config`), the first of+ /// which also begins zsh's own function path, `/usr/local/share/zsh/site-functions`.+ public static let shellCompletionFolders = [+ "share/zsh/site-functions", "share/fish/vendor_completions.d", "etc/bash_completion.d", "share/pwsh/completions",+ ]private static let protectedFlags = UInt32(SF_RESTRICTED) | UInt32(SF_IMMUTABLE) | UInt32(SF_NOUNLINK)diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swiftindex df445993..24c3ff37 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift@@ -37,8 +37,9 @@ struct AttackRemovalGuardTests {#expect(guardian.allowsRemoval(of: home.appending(path: "Downloads/something.txt")))}- /// Under `/usr` only a link directly in a folder command-line tools are linked into may go, and only a link may- /// go back there. A file, a name with nothing under it yet, and anything deeper stay refused.+ /// Under `/usr` only a link directly in a folder command-line tools or their shell completions are linked into+ /// may go, and only a link may go back there. A file, a name with nothing under it yet, and anything deeper stay+ /// refused.@Test func underUsrOnlyAToolsLinkMayGoOrComeBack() throws {let directory = try TemporaryDirectory()let guardian = RemovalGuard(environment: SearchEnvironment(@@ -51,13 +52,17 @@ struct AttackRemovalGuardTests {let trashedFile = try directory.file("home/.Trash/file")let name = "peel-test-\(UUID().uuidString)"- for folder in ["/usr/local/bin", "/usr/local/sbin"] {+ let completions = [+ "/usr/local/share/zsh/site-functions", "/usr/local/share/fish/vendor_completions.d",+ "/usr/local/etc/bash_completion.d", "/usr/local/share/pwsh/completions",+ ]+ for folder in ["/usr/local/bin", "/usr/local/sbin"] + completions {let destination = URL(filePath: "\(folder)/\(name)")#expect(guardian.allowsPuttingBack(trashedLink, at: destination), "a link can't go back to \(folder)")#expect(!guardian.allowsPuttingBack(trashedFile, at: destination), "ATTACK SUCCEEDED: a file can go to \(folder)")#expect(!guardian.allowsRemoval(of: destination), "a name with nothing there was allowed in \(folder)")}- for path in ["/usr/bin/\(name)", "/usr/local/bin/deeper/\(name)", "/usr/local/\(name)"] {+ for path in ["/usr/bin/\(name)", "/usr/local/bin/deeper/\(name)", "/usr/local/\(name)", "/usr/local/share/zsh/\(name)"] {#expect(!guardian.allowsPuttingBack(trashedLink, at: URL(filePath: path)), "ATTACK SUCCEEDED: a link can go to \(path)")}#expect(!guardian.allowsRemoval(of: URL(filePath: "/usr/bin/true")))diff --git a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swiftindex cefc1064..bfa6941d 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift@@ -1214,6 +1214,37 @@ struct LeftoverScannerTests {#expect(try #require(found["tunewell-cli"]?.size) < 64_000)}+ /// An installer can link the shell completions of an app's tools into the folders a Homebrew cask uses, in either+ /// prefix. A link there that leads into the app is the app's; a formula's link and a file are not.+ @Test func findsTheAppsShellCompletionLinks() async throws {+ let directory = try TemporaryDirectory()+ let app = InstalledApp(+ url: directory.url.appending(path: "root/Applications/Tunewell.app", directoryHint: .isDirectory),+ bundleIdentifier: "net.example.client", name: "Tunewell"+ )+ let resources = try directory.directory("root/Applications/Tunewell.app/Contents/Resources")+ let folders = ["share/zsh/site-functions", "share/fish/vendor_completions.d", "etc/bash_completion.d", "share/pwsh/completions"]+ let places = folders.flatMap { ["usr/local/\($0)", "opt/homebrew/\($0)"] }+ for (index, place) in places.enumerated() {+ try FileManager.default.createSymbolicLink(+ atPath: try directory.directory("root/\(place)").appending(path: "tunewell\(index)").path(percentEncoded: false),+ withDestinationPath: resources.appending(path: "completion\(index)").path(percentEncoded: false)+ )+ }+ try FileManager.default.createSymbolicLink(+ atPath: directory.url.appending(path: "root/opt/homebrew/share/zsh/site-functions/_git").path(percentEncoded: false),+ withDestinationPath: "../../../Cellar/git/2.51.0/share/zsh/site-functions/_git"+ )+ try directory.file("root/opt/homebrew/share/zsh/site-functions/_tunewell")++ let scan = await LeftoverScanner(environment: environment(in: directory)).scan(app, installedApps: [app])+ let found = scan.leftovers.filter { $0.kind == .shellCompletions }++ #expect(Set(found.map(\.url.lastPathComponent)) == Set(places.indices.map { "tunewell\($0)" }))+ #expect(found.allSatisfy { $0.match.reason == .linksToTheApp && $0.match.confidence == .certain })+ #expect(!scan.leftovers.contains { ["_git", "_tunewell"].contains($0.url.lastPathComponent) })+ }+/// Homebrew links a cask's commands into its own `bin`, `/opt/homebrew/bin` on Apple silicon (Cask Cookbook,/// `binary`). A link there that leads into the app is the app's, as one in `/usr/local/bin` is.@Test func findsTheAppsLinkInHomebrewsBin() async throws {diff --git a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swiftindex 7ebd4016..2c416b4e 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift@@ -880,6 +880,25 @@ struct OrphanScannerTests {#expect(Set(try #require(groups["com.remembered.app"]).items.map(\.url.lastPathComponent)) == ["rem", "com.remembered.app"])}+ /// A shell completion an app's installer linked into zsh's folder leads nowhere once the app is gone, and zsh+ /// then complains in every new shell. It is listed as a tool's link is.+ @Test func listsAShellCompletionThatLeadsIntoAnAppThatIsGone() async throws {+ let directory = try TemporaryDirectory()+ let folder = try directory.directory("root/usr/local/share/zsh/site-functions")+ try FileManager.default.createSymbolicLink(+ atPath: folder.appending(path: "_gone").path(percentEncoded: false),+ withDestinationPath: directory.url.appending(path: "root/Applications/Gone.app/Contents/Resources/_gone")+ .path(percentEncoded: false)+ )++ let groups = await scanner(in: directory).scan(installedApps: installed).groups++ let gone = try #require(groups.first { $0.identifier == "Gone" })+ #expect(gone.items.map(\.url.lastPathComponent) == ["_gone"])+ #expect(gone.items.allSatisfy { $0.kind == .shellCompletions })+ #expect(gone.confidence.reasons == [.leadsIntoAnAppThatIsGone])+ }+/// In root's `/usr/local/bin`, a link into an app that is gone leads nowhere, which is the one kind of item the/// helper takes from there, so it is offered like anything else the helper can move.@Test(.permissionsHold) func aLinkIntoAnAppThatIsGoneIsWithinTheHelpersReach() async throws {diff --git a/Packages/PeelCore/Tests/PeelCoreTests/TrashServiceTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/TrashServiceTests.swiftindex 47f445ff..e20861b3 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/TrashServiceTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/TrashServiceTests.swift@@ -90,14 +90,18 @@ struct TrashServiceTests {)}- /// A command-line tool's link leads into its app until the app has moved, and the helper takes such a link only- /// once it leads nowhere, so the links go to the helper after everything else, in whatever order they came.+ /// A command-line tool's link, and its shell completion's, lead into its app until the app has moved, and the+ /// helper takes such a link only once it leads nowhere, so the links go to the helper after everything else, in+ /// whatever order they came.@Test func sendsAToolsLinkToTheHelperAfterTheAppItLeadsInto() async throws {let directory = try TemporaryDirectory()let app = try directory.directory("root/Applications/Tool.app")try directory.directory("root/usr/local/bin")+ try directory.directory("root/usr/local/share/zsh/site-functions")let link = directory.url.appending(path: "root/usr/local/bin/tool")try FileManager.default.createSymbolicLink(at: link, withDestinationURL: app.appending(path: "Contents/MacOS/tool"))+ let completion = directory.url.appending(path: "root/usr/local/share/zsh/site-functions/_tool")+ try FileManager.default.createSymbolicLink(at: completion, withDestinationURL: app.appending(path: "Contents/Resources/_tool"))let batches = Mutex<[[String]]>([])let service = TrashService(environment: SearchEnvironment(@@ -111,8 +115,8 @@ struct TrashServiceTests {moveToTrash: { _ in throw CocoaError(.fileWriteNoPermission) })- _ = await service.trash([link, app], usingHelperFor: [link, app])- #expect(batches.withLock { $0 } == [["Tool.app"], ["tool"]])+ _ = await service.trash([link, completion, app], usingHelperFor: [link, completion, app])+ #expect(batches.withLock { $0 } == [["Tool.app"], ["tool", "_tool"]])}/// An item inside a folder that just moved went with it, whatever its name begins with: it is neither moveddiff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swiftindex 7e0bb4fc..a54fccf8 100644--- a/Peel/Views/Presentation.swift+++ b/Peel/Views/Presentation.swift@@ -73,6 +73,7 @@ extension SearchLocation.Kind {case .library: "Library Folder"case .temporaryItems: "Temporary Files"case .commandLineTools: "Command-Line Tool"+ case .shellCompletions: "Shell Completion"case .nativeMessagingHosts: "Browser Extension Helper"case .elsewhere: "Elsewhere"case .sharedFolder: "Shared Folder"@@ -87,7 +88,7 @@ extension SearchLocation.Kind {case .applicationScripts: "applescript"case .caches: "archivebox"case .temporaryItems: "hourglass"- case .commandLineTools: "terminal"+ case .commandLineTools, .shellCompletions: "terminal"case .nativeMessagingHosts: "puzzlepiece.extension"case .elsewhere: "mappin.and.ellipse"case .containers, .groupContainers, .safariWebApps: "shippingbox"diff --git a/SAFETY.md b/SAFETY.mdindex 8a5e7955..4e42389e 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -319,9 +319,11 @@ and it fails closed.refused by the label each daemon declares, not by its file name, and if that list cannot be read itrefuses every daemon rather than allowing them all. It never acts on itself: Peel's helper is installedand uninstalled in Settings, and Background Items shows it without controls.-- From the folders command-line tools are linked into, `/usr/local/bin` and `/usr/local/sbin`, it takes only- a link, never a file, and only one that leads nowhere. Peel sends an app's links there after the app itself,- so they go once the app is gone, and a link that still leads to something stays.+- From the folders command-line tools and their shell completions are linked into, `/usr/local/bin`,+ `/usr/local/sbin`, and the completion folders of `/usr/local` (`share/zsh/site-functions`,+ `share/fish/vendor_completions.d`, `etc/bash_completion.d`, and `share/pwsh/completions`), it takes only a link,+ never a file, and only one that leads nowhere. Peel sends an app's links there after the app itself, so they go+ once the app is gone, and a link that still leads to something stays.- It never reuses a path after checking it. It holds the parent directory open and works through thatdescriptor, so a folder swapped after the check leads nowhere.- "Put Back" is asked for by a record any process running as you can rewrite, so the helper believes none of