Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

statusline-command.sh uses macOS-only stat syntax (breaks on Linux)

Open noxx opened this issue 3 weeks ago • 0 comments

The statusline script uses stat -f%m which is macOS syntax. On Linux, this fails silently and breaks the ccusage cache timing.

Location: statusline-command.sh lines 117 and 165

Current (macOS only): cache_age=$(($(date +%s) - $(stat -f%m "$CACHE_FILE" 2>/dev/null || echo 0)))

Fix (cross-platform): cache_age=$(($(date +%s) - $(stat -c%Y "$CACHE_FILE" 2>/dev/null || stat -f%m "$CACHE_FILE" 2>/dev/null || echo 0)))

Tries Linux syntax first (-c%Y), falls back to macOS (-f%m).

My PAI caught this during a PAI health check and applied the fix locally. Sharing in case others hit the same issue on Linux.

noxx avatar Dec 21 '25 02:12 noxx