Skip to content

feat: turn Remote Control on in running sessions from ^X V - #383

Merged
brtkwr merged 1 commit into
mainfrom
feat/remote-control-chord
Nov 23, 2026
Merged

brtkwr merged 1 commit into
mainfrom
feat/remote-control-chord

Conversation

@brtkwr

@brtkwr brtkwr commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Opus 5.5 ✨

What changes

^X V now opens a small popup instead of flipping a setting straight away:

  • t turns Remote Control on now in the selected session, under its ccs name, so it shows in the Claude app.
  • a does the same for every running session that can take it.
  • v is the old ^X V: the setting for sessions ccs launches or resumes.

Every other ^X letter is taken (R, C, P and M included), and V already meant Remote Control, so the new actions sit behind it.

How it works

Terminal sessions have no non-interactive way in, so ccs types /remote-control <name> plus Enter into the session's terminal. It uses the same path as a / command from the message box. typeSlash is split into slashRefusal (the checks made on the key) and typeSlashNow (finds the terminal, then checks everything again just before the keys). ^X V calls both, so the checks aren't duplicated.

ccs types only when all of these hold:

  • It's a Claude Code session in iTerm or tmux. Codex, agy, subagent rows, background sessions and app-hosted sessions are refused.
  • It's idle.
  • It's the same process. sessions.StillTheSession checks this again immediately before the keys.
  • ccs holds no prompt for it (heldFor).
  • Its session file has no bridgeSessionId. This is checked on the key through the new SessionStat.Remote flag, and again from the fresh file just before the keys. With Remote Control already on, the command opens a menu that waits for a key.
  • It has a valid ccs name (state.SessionName).

After typing, ccs polls the session file for up to 15s until bridgeSessionId appears, and says so in the session's box if it doesn't. A skipped session gets a grey note saying why. Every session, typed or skipped, gets a line in the activity log.

One small behaviour change: /cmd from the message box now refuses background sessions and subagent rows on the key with a clear reason. Before, these failed later with "isn't in iTerm or tmux".

Tested

  • Unit tests in internal/tui/remote_test.go. They cover typing and confirming, typed but not confirmed, and the refusals: already on, turned on between the key and the keys, busy, waiting, turned busy before the keys, another session in the pid, a held prompt, background, app-hosted, no name, Codex. They also cover a skipping a session it can't verify.
  • End to end with a throwaway session, rc-probe-zx41, in a detached tmux session of its own. I drove a build of this branch with ^X V then t. The session printed /remote-control is active, its session file gained bridgeSessionId and stayed idle, and ccs reported it on. A second t was refused as already on. The test session is closed. a was never pressed in that run, since it would have reached real sessions.
  • In that run the first t was refused once with "process couldn't be checked against its session file", even though the popup had just listed the session as ready. The refusal was correct for that moment: the live tick hadn't yet verified the pid. The next press worked.

Not tested: sessions after a cswap switch

A session whose history Claude Code suppresses (one started under another organisation, as after a cswap switch) may still show a wrong name on the phone. Before this PR, only --remote-control <name> at start was known to get past that, and ^X R restart does that since v0.187.1 (#382). I haven't tested whether the slash command's name argument gets past it as well. Testing it needs a cswap account switch, which changes the account for every running session on the machine, so I left it. The README says to use ^X R for those sessions.

Demo

The popup opens only on ^X V, which demo/record.py never presses, so the GIF is unchanged.

🤖 Generated with Claude Code

^X V now opens a popup: t turns Remote Control on now in the selected
session, a in every running session that can take it, and v is the old
setting for sessions ccs starts. ccs types `/remote-control <name>`
into the session's terminal, through the same checks as a / command
from the message box (slashRefusal on the key, typeSlashNow just
before the keys), and only into an idle Claude Code session in a
terminal with no bridgeSessionId, since with Remote Control on the
command opens a menu. Afterwards it waits for bridgeSessionId to
appear and says if it didn't. Each session gets a note in its box and
a line in the activity log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brtkwr
brtkwr enabled auto-merge November 23, 2026 04:03
@brtkwr
brtkwr merged commit e39a4a6 into main Nov 23, 2026
1 check passed
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