diff --git a/docs/reference.md b/docs/reference.md index fe3128c05..0551d31fc 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -3034,8 +3034,14 @@ shows. So magpie finds its session with `rex ls --json` and runs `rex run -s --label= -- /bin/sh -c '; exec $SHELL -l'`, then names the new tab with `rex window rename`. With no such session (or one that ended since the list) it runs `rex new magpie --window= -- …`, -whose first tab is so named. When Rex's server can't be reached (exit 4) it -says to open Rex. The same applies to an agent's *Open in terminal* and a +whose first tab is so named. A tab added from outside shows only in the +app's sidebar, so magpie then brings Rex forward and asks the app to go to +it: it takes the client of kind `app` from `rex client list --json` (the one +attached to its session, else the last app connected) and runs +`rex -C do session.select session_id= window_id=`. +That needs *Remote Control* on in Rex's settings; with it off, with no app +connected, or with no answer in 3 seconds, the tab stays open where it is. +When Rex's server can't be reached (exit 4) it says to open Rex. The same applies to an agent's *Open in terminal* and a carried-over session (StringKe, #4565; [`terminal_rex.go`](../internal/gui/terminal_rex.go)). diff --git a/internal/gui/terminal_rex.go b/internal/gui/terminal_rex.go index 4a5b835c4..5d3261ca8 100644 --- a/internal/gui/terminal_rex.go +++ b/internal/gui/terminal_rex.go @@ -10,6 +10,7 @@ import ( "os" "os/exec" "path/filepath" + "slices" "strings" "sync" "time" @@ -178,6 +179,11 @@ const rexSessionLabel = "magpie" // block, not the tab). With none, `rex new magpie --window