Skip to content

suppressWhenFocused does not work when using Tmux with more than 1 connected client #71

@riuoku

Description

@riuoku

Description

suppressWhenFocused does not suppress notifications in tmux when the tmux session has multiple attached clients.

Environment

  • Plugin: @mohak34/opencode-notifier@0.2.3
  • Platform: Linux X11
  • tmux in use
  • suppressWhenFocused: true

Observed behavior

Even when the OpenCode terminal/pane is focused, notifications are still sent.

What I found

The focus check parses:

tmux display-message -p '#{session_attached} #{window_active} #{pane_active}'

On my setup it returns:

2 1 1

Current logic treats focus as true only when:

  • session_attached === "1"
  • window_active === "1"
  • pane_active === "1"

So 2 1 1 is incorrectly treated as not focused.

Why this is wrong

session_attached in tmux is a count of attached clients, not a boolean:

  • 0 = detached
  • 1+ = attached

So 2 should still be considered attached/valid for focus suppression.

Expected behavior

suppressWhenFocused should suppress notifications when:

  • session_attached > 0
  • window_active === 1
  • pane_active === 1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions