Give construct ssh keepalives by default - #1186
Merged
Merged
Conversation
Long-lived remote TUI sessions die with "Connection reset by peer" / "Broken pipe" when idle Wi-Fi or NAT drops the TCP path. Inject ServerAliveInterval=30 and ServerAliveCountMax=6 into the ssh argv when the user has not already set those options, so construct ssh stays up without requiring ~/.ssh/config changes.
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.
Summary
construct sshsessions die when the underlying SSH TCP path idles out (common on Wi‑Fi / home NAT). The TUI then vanishes with OpenSSH errors (Connection reset by peer,client_loop: send disconnect: Broken pipe) — not a Construct panic.This PR makes the wrapper inject modest client keepalives automatically:
-o ServerAliveInterval=30-o ServerAliveCountMax=6If the user already passed either option (
-o ServerAliveInterval=…, compact-oKey=…, any case), that setting is left alone and only the missing default is added.No user config change required.
Test plan
cargo test -p construct-cli clipboard_bridge(16 tests)cargo build -p construct-cliconstruct ssh <host>, leave idle ~a few minutes on flaky Wi‑Fi; session should stay up. Override withconstruct ssh -o ServerAliveInterval=10 hostand confirm no duplicate default interval.