Files
tty7/src
l0ng-ai 32029f4733 fix(ssh): a typed port of 22 outranks an alias that sets its own
Quick connect merged the typed line over a matching `~/.ssh/config` alias
by asking whether the parsed port was 22. Port 22 is also what the parser
fills in when nothing named a port, so `myalias -p 22` against an alias
carrying `Port 2222` read as silence and connected to 2222. Checked
against the reference: `ssh -G -F cfg -p 22 myalias` reports port 22, the
command line outranking the config file.

The parser already knew — it tracks `Option<u16>` and only collapses it at
the end — so the answer is carried out as `port_given` rather than
recovered from a value that cannot hold it.

The merge itself moves out of the event handler into
`merge_typed_ssh_over_alias`, which is what let this be tested at all: the
rule is now stated in one place and covered for the typed `:22` spelling,
the silent case, an ordinary non-default port, and no alias at all.

The other `port == 22` comparisons are display code deciding whether to
print `:22`, which is correct and unchanged.
2026-08-16 17:19:09 +08:00
..