fix(pai-statusline): Linux/WSL compatibility and UX improvements
Summary
Fixes several issues preventing the pai-statusline pack from working correctly on Linux/WSL systems.
Before / After
| Before (Broken) | After (Fixed) |
|---|---|
![]() |
![]() |
Bug Fixes
1. Cross-platform stat command
The script used macOS-only stat -f %m syntax. Linux requires stat -c %Y.
Fix: OS detection at 3 locations:
if [[ "$OSTYPE" == "darwin"* ]]; then
stat -f %m "$FILE"
else
stat -c %Y "$FILE"
fi
2. jq not documented as dependency
The README stated dependencies: [] but the script uses jq 20+ times for JSON parsing. Without jq, all values silently fail to defaults.
Fix: Updated README to document jq as required dependency.
3. PWD has no fallback
When JSON input lacks directory info, PWD displays empty.
Fix: current_dir="${current_dir:-$PWD}"
UX Improvements
4. Icon spacing in MEMORY line
Before: 📁0 Work │ ✦2 Ratings
After: 📁 0 Work │ ✦ 2 Ratings
5. "No data" indicator changed from — to -.-
Why: When bugs occurred (missing jq, failing stat), the display showed — - identical to "no data available". This made debugging impossible since errors looked like missing data.
-.- is:
- Visually consistent with decimal format (
X.X) - Clearly intentional, not an error fallback
- Self-documenting as "placeholder for number"
Test Environment
- OS: Ubuntu (WSL2)
- Kernel: 6.6.87.2-microsoft-standard-WSL2
- Claude Code: 2.1.11
Test Plan
- [x] Verified location displays correctly (Queens, New York)
- [x] Verified PAI version displays (v2.3)
- [x] Verified PWD displays directory name
- [x] Verified weather displays
- [x] Verified context percentage and sparklines work
- [x] Verified MEMORY line spacing
- [x] Verified
-.-shows for periods with no rating data
🤖 Generated with Claude Code

