Files
cpython/Misc/NEWS.d/next/Library/2025-11-15-23-14-30.gh-issue-138577.KbShrt.rst
T
Sanyam Khurana 7f0c4f6a0b gh-138577: Fix keyboard shortcuts in getpass with echo_char (#141597)
When using getpass.getpass(echo_char='*'), keyboard shortcuts like
Ctrl+U (kill line), Ctrl+W (erase word), and Ctrl+V (literal next)
now work correctly by reading the terminal's control character
settings and processing them in non-canonical mode.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-30 11:11:13 +02:00

5 lines
326 B
ReStructuredText

:func:`getpass.getpass` with non-empty ``echo_char`` now handles keyboard shortcuts
including Ctrl+A/E (cursor movement), Ctrl+K/U (kill line), Ctrl+W (erase word),
and Ctrl+V (literal next) by reading the terminal's control character settings
and processing them appropriately in non-canonical mode. Patch by Sanyam Khurana.