Repository navigation
feat(terminals): per-tab activity indicators - #944
Merged
Merged
Conversation
brennanb2025
force-pushed
the
brennanb2025/notif-on-pane
branch
from
April 22, 2026 18:14
d1fe4df to
87e3a51
Compare
Per-tab activity indicator (amber wash + bottom accent strip + bell
glyph on the tab) driven by the agent working→idle title transition.
- Mark path: `onAgentBecameIdle` in `pty-connection.ts` fires
`markWorktreeUnread`, `markTerminalTabUnread`, and
`dispatchNotification({ source: 'agent-task-complete' })` on the
single per-task transition Claude/Gemini/Codex emit via OSC title.
- Clear path: `setActiveTab` / `activateTab` / `focusGroup` clear the
dot, all guarded on the active worktree. Tab-close and worktree
teardown also clean up.
- Visible-group guard: `markTerminalTabUnread` skips marking when the
tab is the active tab of any visible split group in the active
worktree.
- 2s reattach grace window in `pty-transport.ts` suppresses catch-up
working→idle transitions from the daemon's eager-buffer flush.
- Restored `bell-detector.ts` for BEL-driven attention signal on
non-agent panes.
See PR #944 for full rationale and the BEL-based alternatives that
were considered and rejected.
brennanb2025
force-pushed
the
brennanb2025/notif-on-pane
branch
from
April 24, 2026 18:57
85c9b60 to
7c45464
Compare
Keep the amber background wash and bell icon as the unread signal — drop the bottom accent bar so the tab bar reads less noisy.
4 of 7 tasks
nwparker
added a commit
that referenced
this pull request
Apr 28, 2026
… (#1200) Co-authored-by: Orca <[email protected]>
4 tasks done
2 of 5 tasks
9 tasks done
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…ablyai#944 (stablyai#1200) Co-authored-by: Orca <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per-tab activity indicator (amber wash + bottom accent strip + bell glyph on the tab) driven by the agent working→idle title transition, reflecting that BEL alone is too ambiguous to drive cross-surface attention.
The signal: agent working→idle
onAgentBecameIdleinpty-connection.tsfiresmarkWorktreeUnread,markTerminalTabUnread, anddispatchNotification({ source: 'agent-task-complete' })on the single per-task transition Claude/Gemini/Codex emit via OSC title.setActiveTab/activateTab/focusGroupclear the dot, all guarded on the active worktree. Tab-close and worktree-teardown also clean up.markTerminalTabUnreadskips marking when the tab is the active tab of any visible split group in the active worktree — no spurious dots on panes the user can already see.Why not BEL
We iterated through two BEL-based designs before settling on the title-transition approach:
wasAgentPanelatch + in-memorypaneIsInAgentMode) — spurious bells on every pane click. Root cause: xterm.js honors DECSET 1004 (focus-event reporting) when a TUI requests it, and Orca's daemon persists xterm.js state across app restarts by design. If the TUI exits uncleanly (Orca restart while Claude is running, SIGKILL, crash), the mode bit stays set. Every subsequent click emits\e[I/\e[Ointo the shell, zsh rings its undefined-key bell, and the bell detector flagged it correctly — but the BELs were noise, not attention.Terminals with ephemeral state (no cross-restart persistence) dodge the stuck-DECSET problem because closing a tab destroys the Terminal and new tabs start clean. Orca keeps daemon-backed persistence, so the signal source has to be the unambiguous agent title transition instead of BEL.
Full rationale lives in the long-form comment above
onAgentBecameIdleinsrc/renderer/src/components/terminal-pane/pty-connection.ts.What was removed
onBellhandler inpty-connection.ts+ all plumbing inpty-dispatcher.ts,pty-transport.ts,pty-connection-types.ts,use-terminal-pane-lifecycle.ts,TerminalPane.tsx.paneIsInAgentMode/seedClearEligiblein-memory BEL-suppression state.wasAgentPanelatch fromTerminalTab,workspaceSessionSchema, and hydration backfill.clearTabAgentModestore action + dependency threading.src/renderer/src/components/terminal-pane/bell-detector.ts(now orphaned).[notif]diagnosticconsole.logtraces frompty-connection.ts,pty-transport.ts,terminals.ts,agent-detection.ts.tests/e2e/terminal-attention-restart.spec.ts— validated the wasAgentPane hydration path that no longer exists.What stayed
pty-transport.tsthat suppresses catch-up working→idle transitions from the daemon's eager-buffer flush. Fixes phantom unread at startup when a prior-session agent's replayed OSC titles would otherwise look like a fresh completion.markTerminalTabUnreadvisible-group guard — still needed for the agent-idle signal in split-group layouts.hasStrongAgentSignalhelper (now scoped toterminal-helpers.tsfor "reset stale agent title on hydration"; no longer gates BEL).Test plan
Unit tests
pty-connection.test.ts— regression guard thatonBellis never wired;onAgentBecameIdlefires worktree unread + tab unread + OS notification;onAgentExitedclears the prompt-cache countdown.pty-transport.test.ts— reattach grace suppresses replayed catch-up idle transitions; replay does not fireonAgentBecameWorkingfor historical titles; post-flush live working transitions still fire.tabs.test.ts/terminals-hydration.test.ts/terminal-helpers.test.ts— unread clears on tab activation / group focus / tab close / worktree teardown; hydration resets stale agent titles.E2E tests (
tests/e2e/terminal-attention.spec.ts)\e[O/\e[Ifocus-escapes + BEL bursts (the exact byte pattern from the user's console) do NOT raise tab attention.Regression-guard verification
Temporarily re-wired
onBell → markTerminalTabUnreadinpty-connection.ts+ naive BEL detection inpty-transport.tsto simulate the regression. Verified:pty-connection.test.ts › does not wire an onBell handler through to the transport→ failed (as expected).Terminal attention › a raw BEL does not raise tab attention→ failed (as expected).Terminal attention › DECSET 1004 focus-escape BEL churn does not raise tab attention→ failed (as expected).Terminal attention › an agent completion marks a background tab unread and clears on focus→ still passed (positive case unaffected by the break).Restored the fix; all 22 unit tests in the affected files and all 3 e2e tests pass.
Manual verification
^[[I/^[[Oon inter-tab clicks) confirmed stuck DECSET 1004 is a universal "TUI killed uncleanly" issue, not specific to our terminal — it's just hidden in terminals without cross-restart persistence.Follow-ups (not in this PR)
pty-transport.tsto clear mode bits leaked by crashed TUIs. Lower priority with BEL no longer driving attention, but still worth doing — stuck 1004 still puts visible^[[I/^[[Ochars intocat-like foreground processes.terminalBellnotification setting (NotificationsPane.tsx,settings.terminalBellbranch inmain/ipc/notifications.ts). Touches settings schema + migration so deferred for a separate pass.