prompt_pass not working on windows when using CTRL+V to paste the password string to console
Open
Nobody has claimed this yet.
area/prompting
type/bug
- Dominant language
- Python
- Stars
- 358
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
Issue: prompt_pass is not working on windows with CTRL+V being used to enter the input
Repro:
### CODE PART 1 ###
# ** getpass_fails.py ** #
from knack.prompting import prompt_pass
password = prompt_pass(msg="Password: ")
print(password)
Steps to repro:
- Copy a text to clipboard using CTRL+C e.g. "mypassword"
- On CMD or powershell prompt
python getpass_fails.py - On Password: prompt use CTRL+V to paste the copied text.
Actual Behavior:

Expected Behavior:

WORKAROUND: The issue in only in using Ctrl+V to paste. If we use console menu or right click to paste it works correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with knack/prompting.py at prompt_pass and reproduce the issue on Windows CMD or PowerShell using the supplied getpass_fails.py example. Trace the CTRL+V input path and verify that pasted password text is accepted correctly while the prompt retains its expected password behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100