From 6d5d75a4f132ee5e2bb1fa40c2dbaf073a18e539 Mon Sep 17 00:00:00 2001 From: DietrichGebert Date: Tue, 23 Jun 2026 23:46:40 +0200 Subject: [PATCH] docs: clarify uninstall run-order + statusLine ceiling (#278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #228 (issue #226): - README: state that scripts/uninstall.js must run *before* the host remove command, since the script is itself a plugin file and gets deleted by the removal (or run it from a separate clone). - uninstall.js: add a ponytail: comment naming the statusLine match ceiling — substring match + whole-key delete removes a combined (e.g. caveman+ponytail) statusline wholesale; upgrade path noted. - Add trailing newline to the file. Co-authored-by: Claude Opus 4.8 --- README.md | 2 +- scripts/uninstall.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fba2ef..cec9a6f 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ Which files map to which agent: [Agent portability](docs/agent-portability.md). | Pi agent | `pi uninstall ponytail` | | Cursor / Windsurf / Cline / etc. | Delete the copied rule file | -These remove the plugin's own files. They leave behind a small amount of state ponytail writes outside the plugin folder: the mode flag, `~/.config/ponytail/config.json`, and (if you accepted the setup nudge) a `statusLine` entry in `~/.claude/settings.json`. Run `node scripts/uninstall.js` (from this repo, or wherever it was installed) to clean those up too. It only removes the statusLine entry if it points at ponytail's own script, so a statusline you set up yourself is left untouched. +These remove the plugin's own files. They leave behind a small amount of state ponytail writes outside the plugin folder: the mode flag, `~/.config/ponytail/config.json`, and (if you accepted the setup nudge) a `statusLine` entry in `~/.claude/settings.json`. Run `node scripts/uninstall.js` to clean those up too. **Run it before the host remove command above** — the script is itself a plugin file, so removing the plugin first deletes it (or run it from a separate clone of this repo). It only removes the statusLine entry if it points at ponytail's own script, so a statusline you set up yourself is left untouched. ## Commands diff --git a/scripts/uninstall.js b/scripts/uninstall.js index f070d39..e4dce52 100644 --- a/scripts/uninstall.js +++ b/scripts/uninstall.js @@ -26,6 +26,10 @@ try { const raw = fs.readFileSync(settingsPath, 'utf8').replace(/^\uFEFF/, ''); const settings = JSON.parse(raw); const cmd = settings.statusLine && settings.statusLine.command; + // ponytail: substring-match the script name, then drop the whole statusLine + // key. A combined statusline (e.g. caveman+ponytail) whose command contains + // "ponytail-statusline" gets removed wholesale. Parse out only ponytail's part + // if combined statuslines become common. if (typeof cmd === 'string' && cmd.includes('ponytail-statusline')) { delete settings.statusLine; fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8'); @@ -33,4 +37,4 @@ try { } } catch (e) { if (e.code !== 'ENOENT') throw e; -} \ No newline at end of file +}