X Tutup
Skip to content

fix(cli): allow coder ssh --stdio to exit when parent process dies#21583

Merged
johnstcn merged 14 commits intomainfrom
cj/internal-1217
Jan 21, 2026
Merged

fix(cli): allow coder ssh --stdio to exit when parent process dies#21583
johnstcn merged 14 commits intomainfrom
cj/internal-1217

Conversation

@johnstcn
Copy link
Member

@johnstcn johnstcn commented Jan 20, 2026

Relates to coder/internal#1217

Adds a background goroutine in --stdio mode to check if the parent PID is still alive and exit if it is no longer present.

🤖 Implemented using Mux + Claude Opus 4.5, reviewed and refactored by me.

@johnstcn johnstcn self-assigned this Jan 20, 2026
@johnstcn johnstcn changed the title fix(cli): make coder ssh --stdio exit when parent process dies fix(cli): allow coder ssh --stdio to exit when parent process dies Jan 20, 2026
@johnstcn johnstcn requested review from Emyrk and mafredri January 20, 2026 12:57
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to see one integration test as well, perhaps via launching the test binary with a flag/env to simulate processes exiting. This also allows us to test that/if it actually works on different platforms.

@johnstcn
Copy link
Member Author

It would be nice to see one integration test as well, perhaps via launching the test binary with a flag/env to simulate processes exiting. This also allows us to test that/if it actually works on different platforms.

Added in 7fe3ab1

@johnstcn johnstcn requested a review from mafredri January 20, 2026 16:39
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the integration test! A few more comments/observations but should be good to go after that.

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small flag-naming nit, but otherwise LGTM! :shipit:

@johnstcn johnstcn merged commit f799cba into main Jan 21, 2026
25 checks passed
@johnstcn johnstcn deleted the cj/internal-1217 branch January 21, 2026 14:14
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup