11

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.

6

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:

  • 2
    Makes sense. Running docker run ... with sudo fixes my problem. Thanks! – Trent Bing Feb 19 '16 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.