Bash not resizing correctly within interactive Docker container

bashdocker

Every time the terminal size changes, usually bash will resize automatically so that the LINES and COLUMNS are recomputed correctly. But for some reason this isn't working within a Docker container running bash interactively.

I have shopt checkwinsize -s in my bashrc in the Docker container (and verified that it is on using shopt). Same with the host bash session.

I'm out of ideas, really; shopt checkwinsize -s is the only method I have found for getting bash to automatically evaluate resize when the window is resized.

Best Answer

If your shell is su'd to root, Docker may not succeed in sending signals to it, since that crosses a privilege boundary. (This is not just a problem with Docker).

Further reading:

Related Question