Skip to content

Executing an interactive terminal needs keystroke after exiting #1171

Closed

Description

@TheOnlyJho

Rancher Desktop Version

0.7.1

Rancher Desktop K8s Version

1.21.7

What operating system are you using?

Windows

Operating System / Build Version

Windows 10 Home 21H1

What CPU architecture are you using?

x64

Windows User Only

No response

Actual Behavior

When you exit an interactive terminal (you can either "docker run" a shell with a container or "docker exec" a shell in an already running one) it waits for a keystroke before you get back to your command shell and it displays its prompt again.

I have been trying to use testcontainers with Rancher Desktop (that's why I used dockerd). Testcontainers executes commands in running containers for example to test for some docker requirements on startup or to see if a container has opened its exposed port.
All this hangs on execution and runs in a Timeout (or just grinds to a halt) and it might be that this is due to the "not really exiting" problem I described here.

Also I think this could break scripts that just execute a single command (like trivy checking etc.).

Steps to Reproduce

Run Rancher Desktop with dockerd container runtime.
In a cmd shell execute "docker run -it --rm alpine sh".
Exit the container shell by executing "exit".

Result

The cmd shell does not display its prompt but you have to press any key to get back into the cmd shell.

Expected Behavior

The command should completely exit and should not wait for a keystroke.

Additional Information

No response

Activity

  1. evertonlperes commented on Jan 3, 2022

    @evertonlperes
    Contributor

    Issue replicated on Windows 10 PRO, using both cmd and powershell console.
    Linux and macOS are working as expected.

  2. dblanchette commented on Jan 5, 2022

    @dblanchette

    Same here on Windows 10 21H1 with Rancher 0.7.1. This break scripts calling docker command since it never knows when the command exited which is a pretty major blocker for us.

  3. added this to the v1.0.0-beta milestone on Jan 5, 2022
  4. jhollmannk commented on Jan 24, 2022

    @jhollmannk

    This is the last issue for the 1.0.0-beta milestone. Any chance that this will be fixed soon?
    This is the only thing that really prevents us from using RancherDektop because we use testcontainers in our Java-JUnit-Tests and this behaviour breaks almost all the JUnit-Tests.
    So a major blocker for us too. Would be great if this was fixed!

  5. modified the milestones: v1.0.0-beta, v1.0.0 on Jan 24, 2022
  6. gaktive commented on Jan 25, 2022

    @gaktive
    Contributor

    @jhollmannk This will take a bit longer, alas, so we'll target this for right after 1.0.

  7. modified the milestones: v1.0.0, v1.0.1 on Jan 25, 2022
  8. mook-as commented on Jan 25, 2022

    @mook-as
    Contributor

    To give more details:
    I suspect our proxy process is buffering too much, which means the /containers/{id}/wait connection is not closing properly (so the client couldn't tell when it should detach).

    Oddly, watching /wait and force-closing the /attach connection fixes the issue, but that seems… very suspect?

  9. mook-as commented on Jan 27, 2022

    @mook-as
    Contributor

    Making API calls directly, it appears that /wait actually is working correctly; that returns when the container is closed. So we'll have to forcefully terminate the /attach connection instead (which seems wrong).

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions