Skip to content

Conversation

@fayerman-source
Copy link
Contributor

Summary

Fixes several issues preventing the pai-statusline pack from working correctly on Linux/WSL systems.

Before / After

Before (Broken) After (Fixed)
Before After

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

  • Verified location displays correctly (Queens, New York)
  • Verified PAI version displays (v2.3)
  • Verified PWD displays directory name
  • Verified weather displays
  • Verified context percentage and sparklines work
  • Verified MEMORY line spacing
  • Verified -.- shows for periods with no rating data

🤖 Generated with Claude Code

fayerman-source and others added 2 commits January 17, 2026 07:56
Fixes several issues preventing the statusline from working on Linux/WSL:

**Bug Fixes:**
- Cross-platform `stat` command: Use `stat -c %Y` on Linux vs `stat -f %m` on macOS
- PWD fallback: Add `${current_dir:-$PWD}` when JSON input lacks directory
- Document `jq` as required dependency (was unlisted but used 20+ times)

**UX Improvements:**
- Add spacing between icons and numbers in MEMORY line (📁0 → 📁 0)
- Change "no data" indicator from `—` to `-.-` for visual consistency with
  decimal format and to distinguish from error states (silent failures
  previously showed `—` making bugs look like missing data)

Tested on WSL2 (Ubuntu) with Linux kernel 6.6.87.2-microsoft-standard-WSL2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant