Skip to content

Fix SSH config not starting Host on new line - #2

Merged
ret2libc merged 1 commit into
mainfrom
fix/ssh-config-newline
Dec 3, 2025
Merged

Fix SSH config not starting Host on new line#2
ret2libc merged 1 commit into
mainfrom
fix/ssh-config-newline

Conversation

@DarkaMaul

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes a bug where adding a new SSH host entry would concatenate Host to the end of the previous line if the file didn't end with a newline
  • Ensures existing SSH config content ends with a newline before appending new entries
  • Adds test to verify Host entries are on their own lines

Test plan

  • Added test case to verify Host is on its own line
  • All existing tests pass (uv run pytest - 109 passed)

🤖 Generated with Claude Code

When an existing SSH config file didn't end with a newline, the new
Host entry would be concatenated directly to the last line, resulting
in invalid SSH config like "User adminHost newhost".

Now ensures existing content ends with a newline before appending.
Also strengthened the test to verify Host entries start on their own line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ret2libc
ret2libc merged commit 392c165 into main Dec 3, 2025
@dguido
dguido deleted the fix/ssh-config-newline branch January 30, 2026 02:25
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