Skip to content

A workspace closing itself switches me out of the workspace I'm working in #1621

Closed

Description

@natori-hrj

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.

Current behavior

When a workspace closes itself because its last pane's process ended, the focus
moves off the workspace I was working in.

With workspaces X, Y, Z and me working in Y: when X's last pane ends,
X closes itself and the focus moves from Y to Z.

It depends on position. I tried each combination:

  • working in Y, X (before it) closes -> focus moves to Z ← the problem
  • working in Y, Z (after it) closes -> focus stays on Y
  • working in Z (last in the list), X closes -> focus stays on Z
  • only two workspaces, X closes while in Y -> focus stays on Y

So it happens when the workspace that closes sits before mine, and mine is not
the last one in the list.

Related but different: discussion #1328 is about explicitly closing a workspace.
Here I don't close anything — the workspace closes on its own.

Expected behavior

A workspace closing itself removes that workspace and leaves me on the
workspace I was working in.

Reproduction

  1. Create three workspaces in this order: X, Y, Z.
  2. Focus Y, the middle one.
  3. In X, end the last pane's process — typing exit in its shell does it.
  4. X disappears, and the focus moves from Y to Z.

Impact

I get moved to a different workspace with no action on my part and no
indication, so I can start typing into a terminal I didn't mean to be in.

I should be upfront that the conditions are narrow: a workspace has to be down
to a single pane whose process ends by itself, and it has to sit before my
current workspace while mine isn't last. An interactive agent won't trigger it,
since those keep running. I ran into it with a one-shot process; a crash or a
dropped connection would do the same.

Environment

  • Herdr version: 0.7.4
  • Update channel (stable or preview): stable
  • Operating system: macOS 26.3.1
  • Terminal: WezTerm
  • Shell, if relevant: zsh
  • Relevant config, if any: none

Activity

  1. zjbecker commented on Jul 24, 2026

    @zjbecker

    Hitting this too, on 0.7.5. Worth noting it's not limited to a process exiting on its own - a plain herdr pane close on the last pane of a background (non-active) workspace triggers the exact same focus jump.

  2. kangal-bot commented on Jul 27, 2026

    @kangal-bot
    Collaborator

    Implemented on master and queued for the next release. This is not available in a published Herdr release yet.

  3. kunchenguid commented on Jul 28, 2026

    @kunchenguid

    This is exactly what I am seeing on 0.7.5 stable when an orchestrator runs pane.close on the only pane in a background workspace.

    I captured 19 server-confirmed focus moves in one day. My cleanup snapshots the focused tab and restores it 56-197 ms later, but that window is still long enough for keystrokes to land in the wrong pane. I did not capture the visual flash directly, so the measured claim here is the focus move and restore timing.

    Environment: Herdr 0.7.5 stable, protocol 17, macOS 26.5.2, WezTerm, zsh.

    I found this existing report while checking for duplicates, and the pending-release note looks like it covers the same path, so I am adding the operational impact here instead of opening another issue.

  4. ogulcancelik commented on Jul 28, 2026

    @ogulcancelik
    Collaborator

    @kunchenguid thanks for searching past issues before creating another one! i verified this is fixed on master, captain :)

  5. kangal-bot commented on Jul 29, 2026

    @kangal-bot
    Collaborator

    Released on the preview channel in 2026-07-29-44b3adb12552. This is available to preview users, but is not in a stable Herdr release yet.

  6. kangal-bot commented on Aug 3, 2026

    @kangal-bot
    Collaborator

    Released in v0.8.0.

  7. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions