Skip to content

fix(focus): fall back to tmux pane state#69

Merged
mohak34 merged 1 commit into
mohak34:mainfrom
velnae:fix/tmux-focus-fallback
Apr 21, 2026
Merged

fix(focus): fall back to tmux pane state#69
mohak34 merged 1 commit into
mohak34:mainfrom
velnae:fix/tmux-focus-fallback

Conversation

@velnae

@velnae velnae commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a Linux focus helper so tmux pane state can be used as a best-effort fallback when no window id is available
  • preserve the existing window-id path when compositor focus detection works, and document the fallback in the README
  • add focused tests for the new fallback behavior

Why

On my setup, suppressWhenFocused stayed ineffective even after enabling it because Linux window focus detection returned null before tmux state was consulted.

Tested setup where this works

  • OS: Linux
  • Session type: Wayland
  • Desktop: GNOME
  • Terminal: Ghostty
  • Multiplexer: tmux
  • OpenCode notifier version: 0.2.2

With this patch, notifications are suppressed while the current tmux pane is active, which matches the practical expectation for my setup.

Notes

  • This is intentionally a best-effort fallback, not a claim of full GNOME Wayland frontmost-window support.
  • I could not run bun test locally in this environment because bun is not installed here.

@mohak34 mohak34 merged commit aad47ce into mohak34:main Apr 21, 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