Skip to content

feat: add and edit hosts in a form (Ctrl+T / Ctrl+O) - #161

Closed
SmileOniks wants to merge 1 commit into
quantumsheep:masterfrom
SmileOniks:master
Closed

SmileOniks wants to merge 1 commit into
quantumsheep:masterfrom
SmileOniks:master

Conversation

@SmileOniks

Copy link
Copy Markdown
CleanShot 2026-10-26 at 11 32 59@2x Add a HostForm popup in the app: Ctrl+T appends a new host to the last -c/--config path (before the first Match or wildcard Host block), Ctrl+O edits the selected row in place.

Saving goes through the new ssh_config::editor, which rewrites only the changed lines of the host's block, verifies the Host line still lists the row name, and writes atomically via a temp file plus rename.

To locate each row's block, the parser now records the source file and the 0-based index of the Host line on every ssh_config::Host, propagated to ssh::Host as a serde-skipped source field. The config is reloaded after a save.

Add a HostForm popup in the app: Ctrl+T appends a new host to the last
-c/--config path (before the first Match or wildcard Host block), Ctrl+O
edits the selected row in place.

Saving goes through the new ssh_config::editor, which rewrites only the
changed lines of the host's block, verifies the Host line still lists the
row name, and writes atomically via a temp file plus rename.

To locate each row's block, the parser now records the source file and
the 0-based index of the Host line on every ssh_config::Host, propagated
to ssh::Host as a serde-skipped source field. The config is reloaded
after a save.
@quantumsheep

Copy link
Copy Markdown
Owner

Hey, thanks for the contribution and for the time you put into this!

I do not want sshs to write to the user's SSH config file. When sshs parses the file and writes it again, it can delete comments, change the formatting, and also remove options or blocks that the parser does not support.

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