Repository navigation
feat: add and edit hosts in a form (Ctrl+T / Ctrl+O) - #161
Closed
SmileOniks wants to merge 1 commit into
Closed
SmileOniks wants to merge 1 commit into
SmileOniks wants to merge 1 commit into
Conversation
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.