Skip to content

[codex] Fix macOS Bash 3 compatibility - #34

Merged
samleeney merged 1 commit into
mainfrom
codex/fix-macos-bash3
May 19, 2026
Merged

[codex] Fix macOS Bash 3 compatibility#34
samleeney merged 1 commit into
mainfrom
codex/fix-macos-bash3

Conversation

@samleeney

Copy link
Copy Markdown
Owner

Summary

Fixes #32.

  • Adds a shared Bash 4+ requirement helper that re-execs tmux-agent-status entrypoints with a modern Bash when macOS starts them under /bin/bash 3.2.
  • Detects common Homebrew, MacPorts, and Fink Bash paths, with TMUX_AGENT_STATUS_BASH as an explicit override.
  • Wires the helper into session-status.sh, which is sourced before the reported associative-array failures.
  • Documents the macOS brew install bash prerequisite and adds a focused helper test.

Why

macOS ships Bash 3.2, which does not support declare -A or local -A. The sidebar/status scripts use associative arrays in shared collection code, so they need to run under Bash 4 or newer instead of failing when launched from tmux on macOS.

Validation

  • for f in $(rg --files scripts hooks tests | sort); do bash -n "$f"; done
  • for t in tests/*.sh; do bash "$t"; done
  • TMUX_AGENT_STATUS_BASH="$(command -v bash)" bash tests/require-bash4-helper.sh
  • ./scripts/sidebar-signal.sh refresh; echo exit:$?

@samleeney
samleeney marked this pull request as ready for review May 19, 2026 07:21
@samleeney
samleeney merged commit 526121e into main May 19, 2026
2 checks 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.

Dose not work on macOS

1 participant