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

[Feature Request] switch to enable guessing when to allocate a TTY #10227

Closed
jedwards1211 opened this issue Feb 1, 2023 · 1 comment
Closed

Comments

@jedwards1211
Copy link

jedwards1211 commented Feb 1, 2023

Description

So, I see that y'all gave up on tty detection because of some obscure bug in #9035.
But can we have switches in docker exec/run and docker compose exec/run to turn on tty detection when we want to use it?

Having to deal with -i, -t, and -T is driving me insane, especially since the behavior of docker exec and docker compose exec is flagrantly inconsistent in this regard (though the inconsistency is a separate issue):

> echo 'SELECT 1;' | docker         exec    db psql -U postgres
# (no output)

> echo 'SELECT 1;' | docker compose exec    db psql -U postgres
# (outputs "the input device is not a TTY" and exits)



> echo 'SELECT 1;' | docker         exec -i db psql -U postgres
# (operates on piped input)

> echo 'SELECT 1;' | docker compose exec -i db psql -U postgres
# (outputs "the input device is not a TTY" and exits)

> echo 'SELECT 1;' | docker compose exec -T db psql -U postgres
# (operates on piped input)
@ndeloof
Copy link
Contributor

ndeloof commented Feb 6, 2023

#9035 has been revisited, and we auto-disable TTY allocation if user don't use a TTY (see https://github.com/docker/compose/blob/v2/cmd/compose/exec.go#L71)

Distinct default values used by docker-compose is a legacy decision from 2015, we have to live with this.

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

2 participants