#617

mux-activity: under Rex, ↵ focuses on the server but the Rex app does not switch to the pane's session

Openwiiiimmopened 13d ago

Under Rex, pressing ↵ (or f, or clicking a selected row) in mux-activity says focused <pane> in <session>:<window>, but the Rex app does not move when the pane is in a session the app is not showing.

Cause

The widget only calls the server's block focus. That makes the pane's window active in its own session, which an app follows only when it already shows that session. The Rex app now stays attached to every session in its sidebar and shows one of them. So:

  • the app never switches sessions;
  • the note still says focused …, because it checks only whether an app is attached to the session, and now one always is.

Fix

After the server focus, ask each app attached to the pane's session to show it with the app's own session.select (rex -C <client> do session.select session_id=… window_id=…), the same as picking the session in the app. Say in the note when no app is attached, or when an app would not switch and why.

Acceptance

  • ↵ on a pane in another session switches the Rex app to that session and window.
  • A failed switch is named in the note. It is never reported as focused.
  • Unit tests for choosing which apps to ask, the select arguments and the note wording.

Activity

1
linear-code[bot]13d ago