Skip to content

[BUG] Terminal prompt left in wrong place after some commands #13458

@Paraphraser

Description

@Paraphraser

Description

Occasionally, when running docker compose up -d the command-line prompt will be left in the wrong place.

Image

In the image:

  1. Is where the command was issued
  2. Is the responses from the command as it runs
  3. Is where the command-line prompt is left (instead of after the text in step 2). Anything you type after that gets interwoven with the text in step 2.

I was using Node-RED as my test vehicle - making changes to force container re-creation

It does not always happen for every compose command but it does seem to happen reasonably reliably if an edit to .env is involved.

Steps To Reproduce

  1. A service definition containing something like this:

        environment:
          - TEST=${TESTS:-one,two,three}
    
  2. Edit .env so it has something like:

    TESTS=one
    
  3. Run docker compose up -d. This may exhibit the problem.

  4. Edit .env so the variable changes. Example:

    TESTS=one,who
    
  5. Run docker compose up -d. In my testing, this reliably exhibits the problem.

Compose Version

$ docker compose version
Docker Compose version v5.0.0

$ docker-compose version
Docker Compose version v5.0.0

Docker Environment

$ docker info
Client: Docker Engine - Community
 Version:    29.1.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.30.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.0.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 6
  Running: 6
  Paused: 0
  Stopped: 0
 Images: 7
 Server Version: 29.1.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: local
 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: 1c4457e00facac03ce1d75f7b6777a7a851e5c41
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.21-v8+
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 3.704GiB
 Name: sec-dev
 ID: f6406dbb-2fc1-4834-9606-5e826871aec6
 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

Anything else?

I can't pin down when this started but I think it was a little before 5.0.0 - maybe 2.40.3 or perhaps even one before that. Initially I assumed it was just me and it took a while to spot the pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions