settings.json written by Notepad or VS Code on Windows can carry a UTF-8 BOM. JSON.parse then throws SyntaxError, the outer catch swallows it, hasStatusline stays false, and the statusline setup nudge is never emitted. Strip the leading BOM before parsing, matching the existing handling in ponytail-mode-tracker.js. (#96 added a null guard but not BOM stripping.)
This commit is contained in:
@@ -43,7 +43,9 @@ let output = getPonytailInstructions(mode);
|
|||||||
if (!isCodex) try {
|
if (!isCodex) try {
|
||||||
let hasStatusline = false;
|
let hasStatusline = false;
|
||||||
if (fs.existsSync(settingsPath)) {
|
if (fs.existsSync(settingsPath)) {
|
||||||
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
// Strip UTF-8 BOM some editors prepend on Windows (breaks JSON.parse)
|
||||||
|
const raw = fs.readFileSync(settingsPath, 'utf8').replace(/^\uFEFF/, '');
|
||||||
|
const settings = JSON.parse(raw);
|
||||||
if (settings.statusLine) {
|
if (settings.statusLine) {
|
||||||
hasStatusline = true;
|
hasStatusline = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user