Skip to content

Re-index tab numbers when a tab closes via its last pane exiting - #8

Merged
gocanto merged 1 commit into
mainfrom
fix/reindex-tabs-on-pane-exit
Aug 9, 2026
Merged

gocanto merged 1 commit into
mainfrom
fix/reindex-tabs-on-pane-exit

Conversation

@gocanto

@gocanto gocanto commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

Tab numbers were not re-indexed after closing tabs. The plugin code was correct, but Herdr only emits tab.closed for explicit tab closes (herdr tab close, close-tab keybind). When a tab dies because its last pane's shell exits (typing exit, a process ending), Herdr emits pane.exited instead — which the plugin never subscribed to, so later tabs kept stale position numbers.

Reproduced live: killing a middle tab via shell exit left zeta · 5 sitting at display position 4 with no plugin invocation logged.

Fix

  • Subscribe to pane.closed and pane.exited in herdr-plugin.toml
  • Treat both as workspace-level re-sync events in TabNumbersPlugin, mirroring tab.closed / tab.moved
  • Bump plugin to 0.1.8; update docs and tests

Both hooks are idempotent and cheap (0 changed when nothing moved), so pane closes that do not remove a tab are harmless no-ops.

Verification

  • Linked the local plugin and exited a middle tab's shell: pane.exited fired and omega · 4 correctly became omega · 3
  • Explicit herdr tab close path still re-indexes via tab.closed
  • All 24 tests pass (vp test plugins/tab-numbers)

Herdr only emits tab.closed for explicit tab closes. When a tab dies
because its last shell exits, Herdr reports pane.exited instead, so the
plugin never re-synchronised and later tabs kept stale position numbers.

Subscribe to pane.closed and pane.exited and treat both as workspace
re-sync events, mirroring tab.closed and tab.moved.
@gocanto
gocanto merged commit ab29ebc into main Aug 9, 2026
1 check passed
@gocanto
gocanto deleted the fix/reindex-tabs-on-pane-exit branch August 9, 2026 08:16
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.

1 participant