46cf2328aa
macOS ships /bin/bash 3.2 and the script uses #!/bin/bash with set -euo pipefail, so declare -g would abort the SessionStart hook with "invalid option" on every Mac. printf -v writes via assignment semantics (global from inside a function on 3.2+) — same scope outcome, broader compatibility.