aboutsummaryrefslogtreecommitdiff
path: root/menubar/main.swift
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-20 15:01:18 +0300
committerIgor Soarez <igor@soarez.org>2026-10-20 15:01:18 +0300
commitaa4d6fcd9eac0d0fe051d6307ed6009adefbb2e1 (patch)
treec20523f3753f7c04b34f163135d1419094a9838f /menubar/main.swift
parenteed9c9c1141e118e43b0055f935dd891d89bebd6 (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 'menubar/main.swift')
-rw-r--r--menubar/main.swift5
1 files changed, 3 insertions, 2 deletions
diff --git a/menubar/main.swift b/menubar/main.swift
index e9294e8..c1891ab 100644
--- a/menubar/main.swift
+++ b/menubar/main.swift
@@ -136,8 +136,8 @@ final class Menubar: NSObject, NSApplicationDelegate, NSMenuDelegate {
/// The jump shortcut: same as clicking the tmux status line.
@objc private func jumpToTopWaiting() {
DispatchQueue.global().async {
- let output = run(dinggerBinary, ["focus"]) ?? "failed"
- log("jump: dingger focus \(output.isEmpty ? "ok" : output)")
+ let result = runReporting(dinggerBinary, ["focus"])
+ log("jump: dingger focus \(result.ok ? "ok" : "failed: \(result.output)")")
DispatchQueue.main.async { self.refresh() }
}
}
@@ -155,6 +155,7 @@ final class Menubar: NSObject, NSApplicationDelegate, NSMenuDelegate {
}
private func jump(to paneId: String) {
+ log("jump: to \(paneId)")
DispatchQueue.global().async {
focus(paneId)
DispatchQueue.main.async { self.refresh() }