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.

1 Answer 1

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:

1
  • 2
    Makes sense. Running docker run ... with sudo fixes my problem. Thanks!
    – Brandon
    Commented Feb 19, 2016 at 1:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .