Skip to content

[18.09 backport] fixes 1492: tty initial size error - #1775

Merged
andrewhsu merged 2 commits into
docker:18.09from
thaJeztah:18.09_backport_ttyexecresize
Mar 28, 2019
Merged

[18.09 backport] fixes 1492: tty initial size error#1775
andrewhsu merged 2 commits into
docker:18.09from
thaJeztah:18.09_backport_ttyexecresize

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

backport of #1377 and #1529 for 18.09

fixes#1492

For Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64), Docker version 17.12.0-ce, build c97c6d6 / 18.03.0-ce, build 0520e24
When I run: docker exec -it ubuntu /bin/bash
The tty's size is small than window's size.

root@iZ2zeesy3n96esegm7tue0Z:~# docker exec -it ubuntu /bin/bash
root@97b3e229a701:/# ls -a
. .dockerenv bin dev home lib64 mnt proc run srv tmp var
.. .r boot etc lib media opt root sbin sys usr

After I fix the bug:

root@iZ2zeesy3n96esegm7tue0Z:~# ./docker-linux-amd64 exec -it ubuntu /bin/bash
root@97b3e229a701:/# ls -a
. .. .dockerenv .r bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

If not fix this bug, it's too inconvenient for me to use docker exec -it.

- What I did

  1. Fix tty initial size error
    I think it's a bug of dockerd, but for previous dockerd edition, I think we can fix it in cli.
  2. Fix when we use --debug flag, the first shell prompt don't return to the head of line when we got an error in func resizeTtyTo!

- How I did it
func MonitorTtySize in file cli/command/container/tty.go
I move the call resizeTty() to last and run it asynchronously.

  1. Because in sometimes when dockercli call tty resize, the exec have not finished yet. Then we got a message "Error response from daemon: no such exec", but we ignore it, so we need to throw this error and deal with it after 10 milliseconds.
  2. Add \r when logrus.Debugf.

- How to verify it
It's convenient for me to use docker exec -it.
I don't need to resize the window.

- Description for the changelog
fixes tty initial size error

- I have no more cute animal now
Before fix:
vim /etc/mime.types
sk j _1irw za2kc78iody5

After fix:
vim /etc/mime.types
x z0 r5jg_i4h x6m2bny 4

adshmhand others added 2 commits March 26, 2019 12:51
…om moby/moby to docker/cli.
The integration test TestExportContainerWithOutputAndImportImage in moby/moby is the same as TestExportContainerAndImportImage,
except for the output file option. Adding a unit test to cover the output file option of the export command here allows
the removal of the redundant integration test TestExportContainerWithOutputAndImportImage.
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
(cherry picked from commit fc1e11d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Lifubang <lifubang@acmcoder.com>
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 3fbffc6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
MemberAuthor

ping @silvin-lubecki@kolyshkin ptal

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1775 into 18.09 will increase coverage by 0.15%.
The diff coverage is 50%.

@@ Coverage Diff @@## 18.09 #1775 +/- ##
==========================================
+ Coverage 54.07% 54.22% +0.15% 
==========================================
Files 290 290 Lines 19414 19428 +14 ==========================================
+ Hits 10498 10535 +37 + Misses 8244 8214 -30 - Partials 672 679 +7

1 similar comment
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1775 into 18.09 will increase coverage by 0.15%.
The diff coverage is 50%.

@@ Coverage Diff @@## 18.09 #1775 +/- ##
==========================================
+ Coverage 54.07% 54.22% +0.15% 
==========================================
Files 290 290 Lines 19414 19428 +14 ==========================================
+ Hits 10498 10535 +37 + Misses 8244 8214 -30 - Partials 672 679 +7

@silvin-lubeckisilvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztahthaJeztah modified the milestones: 18.09.4, 18.09.5Mar 28, 2019
@andrewhsu
andrewhsu merged commit 19c0311 into docker:18.09Mar 28, 2019
@thaJeztah
thaJeztah deleted the 18.09_backport_ttyexecresize branch March 28, 2019 17:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@thaJeztah@codecov-io@silvin-lubecki@andrewhsu@GordonTheTurtle@adshmh@lifubang