Devices: fixes from review round 12

- A reconnect while an install runs keeps the login it started with; a new
  one from ~/.ssh/config applies after.
- Frame > Open SSH goes through the server, so it uses the same headset and
  address as the app and refuses when there's none.
- A bare frame alias in use when a headset is set up stays selectable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-28 23:21:19 +10:00
1 parent 2e9bc8624b
commit 98ef6944c9
3 files changed
+34 -2

No files matched your search

+8 -1
View File
@@ -413,6 +413,7 @@ class Link:
if before.get("transient") and not before.get("none") and self.routed is not None:
# A bare alias is in use: a headset set up now doesn't take over by itself.
self.override = self.override or before["alias"]
self.session_alias = self.session_alias or before["alias"] # and stays on the list
if self.reg.sync_from_config():
self.devices_changed()
after = self.active_device()
@@ -435,9 +436,15 @@ class Link:
why = self.describe(reasons)
self.last_attempt = now()
self.close_master()
with self.route_lock:
with self.work_lock, self.route_lock:
gen = self.attempt_gen = self.gen
device = self.active_device()
if self.routed and self.routed[0] == device["id"] and self.route_key(device) != self.routed \
and self.work():
# Its login changed in ~/.ssh/config while an install runs: reconnect with the
# one it started with; the change applies once it's done (see watch_config).
device = dict(device, user=self.routed[1], port=self.routed[2])
self.deferred = True
if self.route_key(device) != self.routed:
# Another headset, or a new user or port: nothing may go on using the old
# route, even if this attempt fails.