Describe the bug
Version
1.0.66+ (notification feature introduced in 1.0.66)
Summary
Desktop notifications (attention / idle, added in 1.0.66) do not fire when the
terminal window is in the background but the Copilot session's tab remains the
active tab within that window. Notifications work correctly when switching to a
different tab or a fully separate app.
Root cause (from the shipped bundle)
Notification firing is gated on terminal focus tracked via DEC private mode 1004:
- CLI sends
ESC[?1004h; FocusIn (ESC[I) sets focused=true, FocusOut (ESC[O) sets focused=false.
- Both the attention and idle paths only notify when
focused !== true.
When a window is backgrounded while its active tab is unchanged, many terminals
(and tmux/control-mode setups) do not deliver a FocusOut to the active tab's PTY.
focused therefore stays true and the notification is silently dropped. The CLI
relies solely on DEC-1004 with no fallback, and there is no setting/env to override
the focus gate (only COPILOT_DISABLE_DESKTOP_NOTIFICATIONS to turn them off).
Repro
- Open Copilot CLI in a tab; keep it the active tab in its window.
- Click another window/app so the terminal window loses focus (do NOT switch tabs).
- Trigger an attention/idle notification (e.g. let a task finish / wait for input).
- Expected: desktop notification. Actual: none.
Environment
- OS: macOS
- Terminal: <e.g. iTerm2 x.x / Ghostty / Terminal.app>
- Multiplexer: <tmux x.x (-CC control mode?) / none>
Suggested fix
Either (a) add a fallback / periodic focus re-query so stale focused=true doesn't
suppress notifications, or (b) add an opt-in setting/env (e.g. notifyWhenFocused /
COPILOT_ALWAYS_NOTIFY) to bypass the focus gate.
Affected version
1.0.66+
Steps to reproduce the behavior
- Open Copilot CLI in a tab; keep it the active tab in its window.
- Click another window/app so the terminal window loses focus (do NOT switch tabs).
- Trigger an attention/idle notification (e.g. let a task finish / wait for input).
- Expected: desktop notification. Actual: none.
Expected behavior
notification popup on macOs should still come in.
Additional context
No response
Describe the bug
Version
1.0.66+ (notification feature introduced in 1.0.66)
Summary
Desktop notifications (attention / idle, added in 1.0.66) do not fire when the
terminal window is in the background but the Copilot session's tab remains the
active tab within that window. Notifications work correctly when switching to a
different tab or a fully separate app.
Root cause (from the shipped bundle)
Notification firing is gated on terminal focus tracked via DEC private mode 1004:
ESC[?1004h; FocusIn (ESC[I) sets focused=true, FocusOut (ESC[O) sets focused=false.focused !== true.When a window is backgrounded while its active tab is unchanged, many terminals
(and tmux/control-mode setups) do not deliver a FocusOut to the active tab's PTY.
focusedtherefore staystrueand the notification is silently dropped. The CLIrelies solely on DEC-1004 with no fallback, and there is no setting/env to override
the focus gate (only COPILOT_DISABLE_DESKTOP_NOTIFICATIONS to turn them off).
Repro
Environment
Suggested fix
Either (a) add a fallback / periodic focus re-query so stale
focused=truedoesn'tsuppress notifications, or (b) add an opt-in setting/env (e.g.
notifyWhenFocused/COPILOT_ALWAYS_NOTIFY) to bypass the focus gate.Affected version
1.0.66+
Steps to reproduce the behavior
Expected behavior
notification popup on macOs should still come in.
Additional context
No response