diff options
| author | Igor Soarez <igor@soarez.org> | 2026-10-20 15:01:18 +0300 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-10-20 15:01:18 +0300 |
| commit | aa4d6fcd9eac0d0fe051d6307ed6009adefbb2e1 (patch) | |
| tree | c20523f3753f7c04b34f163135d1419094a9838f /tests/e2e.sh | |
| parent | eed9c9c1141e118e43b0055f935dd891d89bebd6 (diff) | |
fix clicks from the menu bar app: find tmux without homebrew on PATH
launchd starts the menu bar app with PATH=/usr/bin:/bin:/usr/sbin:/sbin,
so the `dingger focus` it runs for every click (panel rows, menu rows, the
jump shortcut) could not find homebrew's tmux and failed with a misleading
"no tmux client attached"; the app discarded the error. dingger now finds
tmux on PATH or in the usual install locations (DINGGER_TMUX overrides),
reports a missing tmux as such, and the app logs failed jumps.
also: panel rows own every click inside them (labels took the clicks and
counted as window-drag background).
e2e step 14 repeats the menu bar row click and dingger focus under
launchd's environment; both fail with the previous binaries.
Diffstat (limited to 'tests/e2e.sh')
| -rwxr-xr-x | tests/e2e.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/e2e.sh b/tests/e2e.sh index 50d7fa7..1a5cba0 100755 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -303,6 +303,30 @@ else fail "menu bar binary not found at $MENUBAR" fi +# --- 14. clicks work with launchd's environment ------------------------------ +# launchd starts the menu bar app with PATH=/usr/bin:/bin:/usr/sbin:/sbin, +# which has no Homebrew tmux; every click runs `dingger focus` from there. +echo "14. launchd environment" +launchd_env() { + env -i HOME="$HOME" PATH=/usr/bin:/bin:/usr/sbin:/sbin DINGGER_TMUX_SOCKET="$SOCK" \ + DINGGER_AGENT_SOCKET="$HOOK" DINGGER_BIN="$DINGGER" "$@" +} +t switch-client -c "$CLIENT" -t "$B1" +expect "client back on wb1" "client_window" wb1 +hook "$A1" working; hook "$A1" idle +expect "A1 done" "opt $A1 @agent_state" done +if [ -x "$MENUBAR" ]; then + launchd_env "$MENUBAR" --click "$A1" 2>"$DIR/click.err" + expect "menu bar row click jumps, under launchd's PATH" "client_window" wa1 + expect "A1 idle after that click" "opt $A1 @agent_state" idle +fi +t switch-client -c "$CLIENT" -t "$B1" +expect "client back on wb1" "client_window" wb1 +hook "$A2" working; hook "$A2" idle +expect "A2 done" "opt $A2 @agent_state" done +launchd_env "$DINGGER" focus +expect "dingger focus (jump shortcut) jumps, under launchd's PATH" "client_window" wa2 + echo echo "$PASSES passed, $FAILS failed" [ "$FAILS" -eq 0 ] || { echo "--- daemon log tail"; tail -30 "$DIR/daemon.log"; exit 1; } |
