Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Preserve Include directives and global SSH config settings#76

Open
aabichou wants to merge 2 commits into
Adembc:main from
aabichou:fix/fix-issue-with-Include-globs
Open

fix: Preserve Include directives and global SSH config settings #76
aabichou wants to merge 2 commits into
Adembc:main from
aabichou:fix/fix-issue-with-Include-globs

Conversation

@aabichou

@aabichou aabichou commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Preserve Global SSH Configuration Directives (Include Statements)

Hello @Adembc, this PR fixes an issue where global SSH configuration directives—especially Include statements—were not even loaded when modifying server entries through the application.

Problematic SSH Config

# =====================================================================
# Includes
# =====================================================================
Include terraform.d/*
Include personal.d/*
Include work.d/*
Include ~/.orbstack/ssh/config

The above config was not loaded or preserved when adding, updating, or deleting servers.

Key Changes

  • Preserve implicit host block: Capture and restore the first host block containing global directives when loading and saving SSH config files.
  • Recursive Include processing: Extract hosts from Include directives recursively to handle all included files.
  • Comprehensive tests: Added include_preservation_test.go to ensure Include directives are preserved across all operations.

Technical Details

  • config_io.go: Store and restore the implicit host block during save operations.
  • mapper.go: Recursively process Include directives to extract hosts from included files.
  • Repository struct: Added implicitHost field to maintain global directives.

Testing

All Include directives are now properly loaded and preserved when:

  • Adding new servers
  • Updating existing servers
  • Deleting servers

✅ Users’ SSH config structure now remains intact, and Include statements continue to work as expected.

Thanks for your time !

gaoyifan reacted with thumbs up emoji Adembc reacted with hooray emoji
@aabichou aabichou changed the title (削除) Fix: Preserve Include directives and global SSH config settings (削除ここまで) (追記) fix: Preserve Include directives and global SSH config settings (追記ここまで) Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /