Enable signal proxying with --tty option #6955
Merged
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.
Fixes #5547
At present, signal proxying doesn't work when --tty is specified during container creation. This patch removes the checks that would otherwise prevent this from happening.
There are a few quirks associated with this. Most notable, SIGTTIN, SIGTTOU, and SIGTSTP are ignored if a TTY is attached. This doesn't seem to be worth fixing - those signals are mostly related to TTYs already, so the pseudo-TTY attached to the container can handle them. Instead, I documented the behavior to prevent confusion.
Also notably, the terminal hijack handler will register a separate signal handler for SIGINT, so sending SIGINT will close the client instead of proxying the signal. This could be fixed, but this would prevent control-C from stopping terminal hijack, which could be undesirable?