You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Credentials input not working with contex.run from within a Devcontainer #1069
While I found several different issues where something related to stdin did or does not work - this one does not seem to be covered, yet:
What happens:
Entering user name/pw from stdin to programm started with c.run does not work. What (mostly) happens:
First character gets swallowed somehow. Have to press the first character twice. Found some issues about that one. And: Looks ike in_stream=False makes the first character appear on the first key press.
PW entry not working: When running inside the devcontainer, after pressing enter to confirm the user name, the password prompt is missing, and nothing happens when I press any key.
pty=True/False does not seem to have an effect
in_stream=False will avoid the 'first-character-gets-swallowed` problem, but still not fix the passwort-entry-problem
You should be able to use the following script to reproduce the issue - when executed from within a devcontainer in VSCode:
importshleximportsysimporttextwrapfrominvokeimportContextINNER_SCRIPT=textwrap.dedent(
""" from getpass import getpass print('=== Please enter your USERNAME ===', flush=True) username = input() print('=== Please enter your PASSWORD ===', flush=True) password = getpass('') print(f'You entered username: {username}') print(f'You entered password: {password}') """
).strip()
print(">>> running via invoke Context.run(pty=True)")
cmd=f"{shlex.quote(sys.executable)} -c {shlex.quote(INNER_SCRIPT)}"Context().run(cmd, in_stream=True)
Activity
hefee commentedon Aug 12, 2026
The underlying issue is properly #1070, but you haven't given a lot background about versions. Run with -- debug. Maybe try if !1077 fixes the issue.