docker/docker — pull request #7567 by mheon (2014-08-13 19:12:02+00:00)
Title: Enable signal proxying with TTY

Fixes #5547

At present, documentation indicates you can use signal proxying in TTY mode, but it's explicitly disabled in the code.

Removing the explicit checks to prevent proxying in TTY mode does not produce any bugs I can find, makes the behavior consistent with documentation, and makes the Docker client a bit more usable than it was before.

Of note: in TTY mode, SIGTTIN, SIGTTOU, SIGTSTP, and SIGINT are not proxied. SIGTTIN, SIGTTOU, and SIGTSTP are handled by the TTY allocated to the process, and consequently not being able to proxy them is not a significant issue. SIGINT is used by the TTY code to cause a graceful exit of the client, which seems to be a good behavior to maintain.

As mentioned previously, I can't find any bugs with this code. The only potential issue I can see is that SIGTERM will no longer stop the client by default, but will instead be proxied through to the container; however, SIGINT will still close only the client, if that is desired.