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

Keypresses are swallowed when running docker-compose exec -T s1 mysql... | less #8428

Closed
x-yuri opened this issue Jul 7, 2021 · 2 comments
Closed

Comments

@x-yuri
Copy link
Contributor

x-yuri commented Jul 7, 2021

Description of the issue

When running commands like docker-compose exec -T s1 mysql... | less you've got to press keys twice (or more) for them to take effect. Although if the output is not long, it works correctly (every keypress leads to an action).

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.29.2, build unknown
docker-py version: 5.0.0
CPython version: 3.9.5
OpenSSL version: OpenSSL 1.1.1k  25 Mar 2021

Output of docker version

Client:
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.16.4
 Git commit:        f0df35096d
 Built:             Fri Jun  4 08:14:39 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.4
  Git commit:       b0f5bc36fe
  Built:            Fri Jun  4 08:14:24 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.5.2
  GitCommit:        36cc874494a56a253cd181a1a685b44b58a2e34a.m
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

services:
  db:
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "true"
    image: mariadb:10.6
version: '3'

Steps to reproduce the issue

$ docker-compose up -d
$ docker-compose exec db mysql -e 'create database d1'
$ zcat dump.sql.gz | docker-compose exec -T db mysql d1

dump.sql.gz

Then run one of these commands:

$ docker-compose exec -T db mysqldump d1 | less
$ docker-compose exec -T db mysql -e 'select * from t1' d1 | less

And try pressing d, u, j, k, q.

Observed result

You've got press the keys twice (or more) for them to take effect. Although if you scroll down enough, they start working on the first press. If the dump is not big, it doesn't have this effect.

Expected result

The way it works with the following command:

$ docker exec $(docker-compose ps -q) mysql -e 'select * from t1' d1 | less

No keypresses are ignored, every keypress is acted upon.

Stacktrace / full error message

(paste here)

Additional information

UPD A simpler way to reproduce:

$ docker-compose exec -T db find / | less

Arch Linux

$ curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

$ less --version
less 581.2 (PCRE2 regular expressions)
Copyright (C) 1984-2021  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less
@x-yuri x-yuri added the kind/bug label Jul 7, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale
Copy link

stale bot commented Apr 27, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant