Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 28, 2019

Conversation

thaJeztah
Copy link
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

adshmh and 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 <[email protected]>
(cherry picked from commit fc1e11d)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Lifubang <[email protected]>
Signed-off-by: lifubang <[email protected]>
(cherry picked from commit 3fbffc6)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 18.09.4 milestone Mar 26, 2019
@thaJeztah
Copy link
Member Author

ping @silvin-lubecki @kolyshkin ptal

@codecov-io
Copy link

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

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

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah modified the milestones: 18.09.4, 18.09.5 Mar 28, 2019
@andrewhsu andrewhsu merged commit 19c0311 into docker:18.09 Mar 28, 2019
@thaJeztah thaJeztah deleted the 18.09_backport_ttyexecresize branch March 28, 2019 17:20
Sign up for free to 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