Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ssh and sshconfig tags for ssh config syntax highlighting. #7041

Closed
coolaj86 opened this issue Sep 16, 2024 · 4 comments · Fixed by #7057
Closed

Allow ssh and sshconfig tags for ssh config syntax highlighting. #7041

coolaj86 opened this issue Sep 16, 2024 · 4 comments · Fixed by #7057
Assignees

Comments

@coolaj86
Copy link

coolaj86 commented Sep 16, 2024

Describe the enhancement

Support ```sshconfig, ```ssh, and ```ssh-config tags for sshconfig highlight blocks.

Support in the Wild

At the time of the previous issue discussion ssh config (#3450), the Include directive for ssh config was not well known, nor widely adopted.

However, now it is supported in macOS, Ubuntu, and many other Linuxes (anything with OpenSSH 8.x or higher): https://man.openbsd.org/ssh_config.5

Although the Include directive does not specify which extension should be used, .ssh and .sshconfig seem to be the common extensions, when one is used. vim also names its syntax highlighting sshconfig.

Specifically, .ssh-config is NOT a common extention and ssh-config is not a common name for the syntax - at least not as far as I can tell.

As can be seen in #3450 (comment), currently only ```ssh-config is supported by GitHub.

Recommendations

I'm recommending that sshconfig, in particular, be added for syntax highlighting as it seems to be the de facto naming convention.

I'd also recommend ssh because it's the most intuitive - and I highly, highly doubt that there will be some sort of OpenSSH DSL script that would need the ssh tag in the future. That said, I do understand that, categorically, ssh might feel wrong as it would seem to describe an ssh DSL rather than a config format. However, since the layperson would reasonably assume that ssh is the syntax and probably isn't aware that sshconfig is the de facto name for the syntax.

On another note, I would argue against ssh_config as the tag as that seems to defy the tag convention, and refers specifically to the file naming convention used for substituting the / in ~/.ssh/config and the suggested system-wide configuration file name /etc/ssh/ssh_config, not the syntax itself.

@lildude
Copy link
Member

lildude commented Sep 16, 2024

We'd certainly accept a PR if you've got the time 😉

@coolaj86
Copy link
Author

coolaj86 commented Sep 16, 2024

I'm not familiar with how the repo is laid out, but a brief search for ssh-config lead me to

SSH Config:
type: data
group: INI
filenames:
- ssh-config
- ssh_config
- sshconfig
- sshconfig.snip
- sshd-config
- sshd_config
ace_mode: text
tm_scope: source.ssh-config
language_id: 554920715

According to that, I would think ```sshconfig should work.

Perhaps the previous test was rendered years ago, made inactive, and never re-rendered. I'll try again now:

```sshconfig

Host my-nickname
  Hostname my-nickname.example.com
  User me

```ssh-config

Host my-nickname
  Hostname my-nickname.example.com
  User me

```ssh_config

Host my-nickname
  Hostname my-nickname.example.com
  User me

```sshdconfig

Host my-nickname
  Hostname my-nickname.example.com
  User me

```sshd-config

Host my-nickname
  Hostname my-nickname.example.com
  User me

```sshd_config

Host my-nickname
  Hostname my-nickname.example.com
  User me

@coolaj86
Copy link
Author

@lildude Can you direct me as to what I should be looking for? The thing that seemed the obvious thing either isn't applied to the deployed GitHub editor at large, or is a red herring.

@lildude
Copy link
Member

lildude commented Sep 16, 2024

If you're wanting to use the various other forms, you should add an aliases entry to the section you found in the languages.yml file. You can find other uses elsewhere in the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants