Skip to content

Fix stat command compatibility for macOS - #29

Merged
samleeney merged 2 commits into
samleeney:mainfrom
zhenya-zhu:fix/macos-stat-compatibility
Apr 15, 2026
Merged

Fix stat command compatibility for macOS#29
samleeney merged 2 commits into
samleeney:mainfrom
zhenya-zhu:fix/macos-stat-compatibility

Conversation

@zhenya-zhu

Copy link
Copy Markdown
Contributor

Summary

  • stat -c %Y is Linux-specific (GNU coreutils) and fails silently on macOS, where the correct syntax is stat -f %m
  • This causes the sidebar collector daemon (sidebar-collector.sh) to never generate .sidebar-cache, and the sidebar renderer (sidebar.sh) to never read it
  • Result: sidebar is completely empty on macOS — no sessions, no agent status, just the separator line

Changes

  • scripts/lib/collect.sh: use stat -f %m on Darwin, stat -c %Y on Linux
  • scripts/sidebar.sh: same fix for the cache mtime check

Test plan

  • Verified on macOS 15.4 (Darwin 25.4.0) with tmux 3.6a — sidebar now populates correctly with INBOX and SESSIONS sections
  • Linux codepath preserved unchanged (else branch)

`stat -c %Y` is Linux-specific and fails silently on macOS (Darwin),
causing the sidebar collector to never write `.sidebar-cache` and the
sidebar renderer to never read it. This results in an empty sidebar
on macOS.

Use `stat -f %m` on Darwin and keep `stat -c %Y` on Linux.
@samleeney

Copy link
Copy Markdown
Owner

LGTM. Great fix — thanks @zhenya-zhu!

# Conflicts:
#	scripts/lib/collect.sh
@samleeney
samleeney merged commit 974b57b into samleeney:main Apr 15, 2026
1 check passed
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.

2 participants