Problem
Issue #495 fixed the stat -f %m macOS-only syntax in the v2.5 statusline, but PAI v3.0 has regressed:
- 10 hardcoded
stat -f %m calls (up from 7 in v2.5)
- No
get_mtime() wrapper function — it's completely absent from the v3.0 release
- No
export -f — even if the function is added, background subshells ({ ... } &) can't see it without export -f get_mtime
On Linux, stat -f means "display filesystem status" (completely different from macOS's "format" flag), so it silently produces unuseable output instead of the desired file modification epoch data.
Symptoms
Linux users see a broken statusline:
- No LOC or weather data
- No Branch, Age, Mod, or New counts
- Empty LEARNING panel
- Blank SK/WF/Hook counts
Fix
1. Add the function after # PARSE INPUT near the top of statusline-command.sh:
# CROSS-PLATFORM HELPERS
get_mtime() {
if [[ "$OSTYPE" == darwin* ]]; then
stat -f %m "$1" 2>/dev/null || echo 0
else
stat -c %Y "$1" 2>/dev/null || echo 0
fi
}
export -f get_mtime
2. Replace all 10 occurrences of stat -f %m "$VAR" 2>/dev/null || echo 0 with get_mtime "$VAR".
Find them with: grep -n 'stat -f %m' statusline-command.sh
3. Ensure fd is available (Ubuntu packages it as fd-find):
sudo apt install -y fd-find
sudo ln -s /usr/bin/fdfind /usr/local/bin/fd
Environment
- Ubuntu Server 24.04.4 LTS (bare metal)
- PAI v3.0 (fresh install from release)
- Claude Code v2.1.42
- Bun 1.3.9
Notes
Problem
Issue #495 fixed the
stat -f %mmacOS-only syntax in the v2.5 statusline, but PAI v3.0 has regressed:stat -f %mcalls (up from 7 in v2.5)get_mtime()wrapper function — it's completely absent from the v3.0 releaseexport -f— even if the function is added, background subshells ({ ... } &) can't see it withoutexport -f get_mtimeOn Linux,
stat -fmeans "display filesystem status" (completely different from macOS's "format" flag), so it silently produces unuseable output instead of the desired file modification epoch data.Symptoms
Linux users see a broken statusline:
Fix
1. Add the function after
# PARSE INPUTnear the top ofstatusline-command.sh:2. Replace all 10 occurrences of
stat -f %m "$VAR" 2>/dev/null || echo 0withget_mtime "$VAR".Find them with:
grep -n 'stat -f %m' statusline-command.sh3. Ensure
fdis available (Ubuntu packages it asfd-find):Environment
Notes
export -f get_mtimeis critical because the statusline runs parallel background subshells that need the function