Skip to content

[BUG] The exec command has --no-tty but run has --no-TTY while both do the same thing #13884

Description

@nickjj

Description

Hi, I believe there is a consistency bug with the long form name of the -T flag.

docker compose exec --help:

 -T, --no-tty Disable pseudo-TTY allocation. By default 'docker compose exec' allocates a TTY.

docker compose run --help:

 -T, --no-TTY Disable pseudo-TTY allocation (default: auto-detected)

I'd suggest using --no-tty for both so they are both lowercase. It will help make both commands more compatible with each other and reduce human error. I think the Docker Compose project prefers the lowercase version because 0cdc5c9 applied this to exec but didn't for run. Might have been an oversight? Looks like the code silently handles --no-TTY for legacy purposes tho.

With that said, I took a shot to start a PR for this change here: #13885

Steps To Reproduce

  • Run the --help command for both and check the output, it's not just visual because if you try running docker compose run --no-tty ... it will throw unknown flag: --no-tty

Compose Version

$ docker compose version
Docker Compose version 5.1.4

Docker Environment

$ docker info
Client:
Version: 29.6.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.35.0
Path: /home/nick/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: 5.1.4
Path: /home/nick/.docker/cli-plugins/docker-compose
Server:
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 48
Server Version: 29.6.0
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: fff62f14765df376e5fc36f5a8f8e795b5670f61.m
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 7.0.12-arch1-1
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.55GiB
Name: kaizen
ID: c3566f3f-bc80-4f37-8fe8-312fd8b17ef5
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false
Firewall Backend: iptables
EnableUserlandProxy: true
UserlandProxyPath: /usr/bin/docker-proxy

Anything else?

No response

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