Files
l0ng-ai 2a0db38bdd fix(ssh): save a tab's connection whole, not just its address (#438)
The tab menu's Save-as-SSH-Host row went through `edit_ssh_host_of_target`,
which for a session dialled by hand knows only `RemoteTarget::Direct { user,
host, port }`. Everything else the live connection carries — its proxy, its
jump host, its identity files, its forwards, its login script and algorithms
— was dropped on the way to the form, so the host that got saved was one
that could not reach the machine it was saved from. An alias out of
`~/.ssh/config` is the everyday case: `quick_connect` resolves its
`ProxyJump` into the spec, and the row offered it back without the hop and
without a word.

The command palette's own Save-Connection-as-Host has read the live spec
since it was written, and pushes `SshSaveDroppedJumpHost` out loud for the
one field it cannot carry — because, as its comment says, silently dropping
the hop would leave a host that saves fine and then cannot be reached. The
tab row carried nothing and said nothing.

`tab_ssh_host_form` now answers with what the row opens rather than with a
target: the saved host by its id when there is one, otherwise the pane's own
spec, handed to the same `save_ssh_spec_as_host` the command now also goes
through. `ssh_host_target_of_spec` stays the gate and the label, so the tab
menu and the switcher's machine menu still cannot drift on which machines
are editable or on what the row is called.

The two ported tests now assert the session that reaches the form rather
than an address, and a third pins the fields that were being lost.
2026-09-07 22:16:31 +08:00
..