10

I am new to using docker. A pre-configured image has been booted and comes up successfully. How can the terminal dimensions be changed - let us say to 60 lines by 120 characters - from the current (small) default?

enter image description here

  • Assuming that this is a terminal on a Mac (given the above graphic), the size is more a function of the script that called Docker than the container running in Docker (i.e., in boot2d0cker). Various people have gotten this to work by switching to iTerm in .boot2docker/terminal (see https://github.com/boot2docker/boot2docker/issues/414). – joatd Sep 09 '16 at 01:46
  • 4
    Applying the host terminal's dimensions to the container terminal may be implemented with issue https://github.com/moby/moby/issues/25450 To manually set the dimensions once inside the container's terminal, you can use stty cols 120 rows 60. – Jānis Elmeris Jul 28 '17 at 10:55
  • @joat That seems a reasonable answer - would you make it one? I will upvote – WestCoastProjects Oct 29 '17 at 12:00

1 Answers1

6

This was fixed in docker master branch some two and a half years later.
https://github.com/moby/moby/issues/25450

https://github.com/moby/moby/pull/37172

It appears that the fix were

docker run --rm -it -e COLUMNS=$COLUMNS -e LINES=$LINES -e TERM=$TERM -it ubuntu:16.04 tput lines

I have not tested it yet.