mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 06:00:33 +02:00
Devices: fixes from review round 16
- Terminals, power and a reconnect's probes use the route commands have now (a pinned bare-alias destination, a login change still deferred). - Saving port 22 keeps an explicit Port line where there was one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
93ebd34f2c
commit
fa05a4b310
4 files changed
+30
-8
No files matched your search
+3
-3
@@ -300,12 +300,12 @@ def _rewritten(lines, alias, hostname, user, port):
|
||||
key = f[0].lower() if f else ""
|
||||
if key in want and want[key] is not None and key not in seen:
|
||||
seen.add(key)
|
||||
if key == "port" and want[key] == "22":
|
||||
continue # the default; connect.sh leaves it out
|
||||
# An existing Port line is kept, even for 22: dropping it could let a later
|
||||
# `Host *` Port apply to Terminal but not to the app.
|
||||
out.append(f" {f[0]} {want[key]}")
|
||||
else:
|
||||
out.append(line)
|
||||
if want["port"] and want["port"] != "22" and "port" not in seen:
|
||||
if want["port"] and want["port"] != "22" and "port" not in seen: # 22 needs no line (as connect.sh writes it)
|
||||
at = next((n + 1 for n, line in enumerate(out) if line.split(None, 1)[:1] == ["HostName"]), 2)
|
||||
out.insert(at, f" Port {want['port']}")
|
||||
new = lines[:i] + out + lines[j:]
|
||||
|
||||
Reference in new issue
Block a user