prompt-toolkit / prompt-toolkit/python-prompt-toolkit

Hide password instead of replacing it with a character

Open
#1,783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

Hey there, questionary user here.

I opened this issue to hide the password that an user types when using questionary.password() (a wrapper around PromptSession(is_password=True): https://github.com/tmbo/questionary/issues/321

Would be nice to specify the character to use to mask the password; right now this is *, and from a quick look it doesn't seem possible to change this behavior from an external user point of view? But correct me if I'm wrong obviously.

Line of code affected: https://github.com/prompt-toolkit/python-prompt-toolkit/blob/490cf900188df357611cdc9358256be0e5ce2e16/src/prompt_toolkit/layout/processors.py#L311

Would be nice to select either the character to use, e.g., empty string "", or just have a switch to mask the password at all, leaving the default * in case the password is not masked.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/prompt_toolkit/layout/processors.py at the password-masking code around line 311, then trace how questionary.password() configures PromptSession(is_password=True). The change is complete when callers can choose a masking character or disable masking while retaining * as the default.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.