zed: Support IPv6 hosts in SCP-style SSH URLs (#62157)
# Objective
- Support opening remote paths from SCP-style SSH URLs that use
bracketed IPv6 hosts, such as `ssh://[2600::]:~/foo`.
## Solution
- Validate SSH hosts with `url::Host::parse`, which supports bracketed
IPv6 addresses while continuing to reject malformed or ambiguous hosts.
- Add test coverage for IPv6 URLs with usernames, home-relative paths,
absolute paths, and explicit ports.
- Add rejection tests for unbracketed IPv6 addresses and ambiguous
port-plus-SCP-path syntax.
## Testing
- Ran `cargo fmt --all -- --check`.
- Ran `cargo test -p zed test_parse_ssh_urls -- --nocapture`.
- Ran `cargo test -p zed test_reject_ssh_urls -- --nocapture`.
- All targeted tests passed on macOS. No additional platform-specific
testing is expected to be necessary because the change only affects URL
parsing.
Release Notes:
- Fixed opening remote paths from SCP-style SSH URLs with IPv6 hosts.
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
a58fff1334Xiaobo Liu committed on 8/20/2026, 5:39:38 AM· committed by GitHubparent32a0e81