From afc11fcc7068846f39179c69770085477c38dba1 Mon Sep 17 00:00:00 2001 From: andyhtran Date: Mon, 11 May 2026 23:44:27 +0900 Subject: [PATCH] Document why cache dir uses ~/.cache/ instead of ~/Library/Caches/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cross-platform path is intentional — SSH paste types it into remote terminals where ~/Library/Caches/ doesn't exist. Add a FAQ entry and an inline comment explaining the invariant. Co-Authored-By: Claude Opus 4.6 --- README.md | 4 ++++ Sources/CopyCat/Settings.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index c0cdb60..83d4f2b 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,10 @@ SSH paste has to use `~/` because the remote home dir is unknown. Your remote us Each screenshot is sent to every enabled host you've configured. With one host it's just SSH paste; with multiple it broadcasts (fans out) to all of them. Toggle individual hosts on/off in the menu bar to control which ones receive a given screenshot. +**Why does CopyCat use `~/.cache/copycat/` instead of `~/Library/Caches/`?** + +So the same path resolves on both your Mac and remote Linux/NixOS hosts. SSH paste types `~/.cache/copycat/screenshot.jpg` into the terminal — that path needs to work on both sides without platform detection or separate configuration. The cache directory is configurable in Settings if you prefer a different location. + **What's the simplest setup?** Leave SSH off. CopyCat then only intercepts ⌘V locally — no SSH, no remote hosts, no Tailscale needed. Turn SSH on when you want to paste into a remote shell. diff --git a/Sources/CopyCat/Settings.swift b/Sources/CopyCat/Settings.swift index 5b1ed4e..8d9feec 100644 --- a/Sources/CopyCat/Settings.swift +++ b/Sources/CopyCat/Settings.swift @@ -38,6 +38,10 @@ enum SettingsDefaults { static let broadcastHotkey: BroadcastHotkey = .cmdV static let cacheKeepCount = 50 + // ~/.cache/copycat/ on all platforms, not ~/Library/Caches/ on macOS. + // SSH paste types this path into the terminal and it must resolve on + // both the local Mac and remote Linux hosts. A single cross-platform + // path keeps that invariant without platform detection or split config. static var cacheDir: URL { FileManager.default.homeDirectoryForCurrentUser .appendingPathComponent(".cache/copycat", isDirectory: true)