Consideration of aligning cases to lower case when compute to match OpenSSH behavior
Summary
OpenSSH treats configuration directives case-insensitively, but ssh-config does not. For example:
Host example
hOsTnaME 1.2.3.4
% ssh -G example
host example
hostname 1.2.3.4
However, SSHConfig.compute() keeps case and developer should be consider it.
Proposal
Add a mechanism to handle directives in a case-insensitive manner to match OpenSSH. Possible approaches include:
- Always normalize directive names to lowercase internally.
- Add an option such as ignoreCase: true for compute() to unify case.
- Maintain both the original and lowercase versions of the directive.
It would be great if ssh-config could support case-insensitive directives to better align with OpenSSH behavior. I'd be happy to contribute a PR if there's a preferred approach.
I'd prefer the second approach, such as compute(host, { lowerCase: true }), to ignore case sensitivity and to convert the parameter names in the result to lower case. Future major release may opt in this flag by default.
Please feel free to send PR :-D