Skip to content

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

@jedwards1211

Description

@jedwards1211

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions