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

feat(ssh/config): handle absolute path includes in ssh config #5184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xxxbrian
Copy link

Absolute path includes are currently not supported by the ssh config. For example, an Include like Include ~/.orbstack/ssh/config would be ignored. This PR adds support for absolute path processing while ensuring that wildcard support is still maintained.

@@ -175,7 +175,13 @@ impl ParsedConfigFile {
groups: &mut Vec<MatchGroup>,
loaded_files: &mut Vec<PathBuf>,
) {
match filenamegen::Glob::new(&pattern) {
let home = dirs_next::home_dir().unwrap_or_default();
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for diving in!

  • Please make the home_dir resolution only trigger when we observe the ~/ prefix.
  • I'm not clear on why the cwd overrides the caller-supplied value for either the ~ or / case; that's something that would benefit from some explanation in the code with comments.
  • Please add unit tests for these new cases! You can find various examples towards the bottom of this file

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.

None yet

2 participants