From de85eb12604e6f1a50ff30014b4a7b995ff72dc1 Mon Sep 17 00:00:00 2001 From: Admin Date: Sat, 27 Jun 2026 20:07:44 +0300 Subject: [PATCH 1/2] fix: only delete ponytail's own statusLine.command not the whole key Previously uninstall deleted the entire statusLine key when it found 'ponytail-statusline' in the command string. Combined statuslines (e.g. caveman+ponytail) would lose other plugins' statuslines. Now only deletes the command field. Closes #374 --- scripts/uninstall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/uninstall.js b/scripts/uninstall.js index e4dce52c..e8046747 100644 --- a/scripts/uninstall.js +++ b/scripts/uninstall.js @@ -31,7 +31,7 @@ try { // "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; + delete settings.statusLine.command; fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8'); console.log(`Removed ponytail statusLine entry from ${settingsPath}`); } From 92c7067f05b18b19966da49c3ba2670730e0b83f Mon Sep 17 00:00:00 2001 From: Admin Date: Sat, 27 Jun 2026 20:07:50 +0300 Subject: [PATCH 2/2] fix: strip UTF-8 BOM before JSON.parse in config Unlike ponytail-activate.js and check-versions.js, this function did not strip BOM before parsing. Config files saved with BOM (common on Windows) silently failed to parse. Closes #375 --- hooks/ponytail-config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/ponytail-config.js b/hooks/ponytail-config.js index 86677b13..88aef884 100644 --- a/hooks/ponytail-config.js +++ b/hooks/ponytail-config.js @@ -83,7 +83,8 @@ function getDefaultMode() { // 2. Config file try { const configPath = getConfigPath(); - const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); + const raw = fs.readFileSync(configPath, 'utf8').replace(/^/, ''); + const config = JSON.parse(raw); if (config.defaultMode && VALID_MODES.includes(config.defaultMode.toLowerCase())) { return config.defaultMode.toLowerCase(); }