Skip to content

subprocess.Popen captures input until stty sane is run #7

@chrishoage

Description

@chrishoage

I've spent some time debugging this and I'm coming up short, so I'm filing this issue in case anyone else has ideas.

Regardless of if a pipe is used (internal vs external encoders) the input to the tty is not displayed until stty sane or reset is blindly typed into the terminal.

I've tried all of the suggestions from https://stackoverflow.com/questions/6488275/terminal-text-becomes-invisible-after-terminating-subprocess however all were unsuccessful beyond stty sane and reset, which are obviously just workarounds.

root@host:/# cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@host:/# python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0] on linux

This is running inside a docker container, accessed with docker exec -it host /bin/bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions