cyjake / ssh-config

📟 SSH config parser and stringifier
MIT License
78 stars 19 forks source link

Values with spaces- IdentityFile vs other #36

Closed roblourens closed 4 years ago

roblourens commented 4 years ago

While working on https://github.com/microsoft/vscode-remote-release/issues/3560, I realized that when stringifying a config value with a space, IdentityFile will be quoted but other properties (such as User) won't be. This is due to https://github.com/cyjake/ssh-config/blob/master/index.js#L174. I see the original discussion that led to this in https://github.com/cyjake/ssh-config/pull/13 but I don't fully understand it. If I have a User with a space, it should also be quoted in the config like User "first last"

Is it possible that the comparison in the PR should be reversed, like "ProxyCommand" is not quoted but all other properties are?

cyjake commented 4 years ago

There still are several options such as SendEnv that allow separating values with whitespace according to ssh-config(5). But in general I think you're right, most of the options should be automatically quoted.

roblourens commented 4 years ago

Thanks!