coder / coder/vscode-coder

Support all accumulating SSH config options instead of re-implementing override behavior

未关闭
#695 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
130
派生
48
平均合并
3 天 3 小时
30 天内合并 PR
15

描述

Currently we manually handle SSH config merging, but this requires re-implementing SSH's "first match wins" override behavior ourselves.

## Proposed approach

Instead of manual merging, let the SSH client handle it natively:
- Place `override` configs first in the file (SSH uses "first match wins")
- Keys without values (for non-accumulating options) can be used to remove the entry if we still want to maintain that behavior
- For accumulating options, pass entries as-is from both configs without combining them

This keeps files leaner while avoiding custom override logic.

## Accumulating SSH options to support

These options accumulate across multiple declarations rather than following "first match wins":

| Option | Behavior |
|--------|----------|
| `IdentityFile` | Tried in sequence |
| `CertificateFile` | Tried in sequence |
| `SetEnv` | All values sent to server |
| `SendEnv` | Accumulates (prefix with `-` to clear) |
| `LocalForward` | Multiple tunnels |
| `RemoteForward` | Multiple tunnels |
| `DynamicForward` | Multiple SOCKS proxies |

Additionally, these use space-separated values: `GlobalKnownHostsFile`, `UserKnownHostsFile`, `PermitRemoteOpen`, `CanonicalDomains`.

## Reference

[OpenBSD ssh_config(5)](https://man.openbsd.org/ssh_config.5)

贡献指南

打开贡献指南

调研方向

Start by locating the current SSH config merging implementation and its tests, then compare its behavior with the referenced OpenBSD ssh_config(5) documentation. Trace how override and accumulating options are represented, and verify that the listed options are passed in the correct order without manual combination. Done means supported accumulating and space-separated options follow native SSH behavior while existing removal behavior remains intact.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。