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

Update ssh.completion.sh to be case-insensitive #645

Merged
merged 9 commits into from
Dec 30, 2024

Conversation

jornodberg
Copy link
Contributor

Also find 'host myhost' and 'HOST myhost' in ssh-config

Also find 'host myhost' and 'HOST myhost' in ssh-config
@jornodberg
Copy link
Contributor Author

This is a commit to solve my own problem #644

Changed to also read 'hostname' in different cases (but not read HashKnownHosts, HostbasedAcceptedAlgorithms, HostbasedAuthentication or HostKeyAlgorithms like it did before).
completions/ssh.completion.sh Outdated Show resolved Hide resolved
@akinomyoga
Copy link
Contributor

Version 4.
Accept Host-line with whitespaces in front. And multiple aliases - also =
For Hostname is respects different cases, and also includes IP-addresses.
@jornodberg
Copy link
Contributor Author

I really didn't know Host could be indented. But I've confirmed that now - so I have adjusted for that.
Never used = myself, so did not take that into account either. But have done that now.

Have tried many different syntaxes in my own ssh-config now, and also confirmed it will suggest IP-adresses from HostName-lines.

Trim whitespaces to not produce empty elements
akinomyoga
akinomyoga previously approved these changes Dec 12, 2024
Further improvements. This will respect the usage of = as separator, and also use of whitespaces before and/or after =.
@akinomyoga
Copy link
Contributor

Do you have an explanation on 551f282?

@jornodberg
Copy link
Contributor Author

I added = as a possible separator

@akinomyoga
Copy link
Contributor

As far as I tried, = can be used to separate the key Host{,Name} and the value (i.e., the list of hostnames), but = cannot be used to separate hostnames. Rather, = can be used as a part of a hostname. Also, man ssh_config mention that = (up to once) can be used to separate the option name and the value, but there is no mention about = as a separator inside the value.

@jornodberg
Copy link
Contributor Author

You are right. This last commit should be abandoned.

Remove = as host separator. I misunderstood.
akinomyoga
akinomyoga previously approved these changes Dec 19, 2024
Copy link
Contributor

@akinomyoga akinomyoga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@akinomyoga akinomyoga merged commit c88bc28 into ohmybash:master Dec 30, 2024
4 checks passed
@akinomyoga
Copy link
Contributor

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants