Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bb60653
gh-138577: Fix keyboard shortcuts in getpass with echo_char
CuriousLearner Nov 15, 2025
31e35e4
Address reviews on dispatcher pattern + handle other ctrl chars
CuriousLearner Nov 16, 2025
b8609bd
Address reviews
CuriousLearner Nov 30, 2025
2691ad9
Merge remote-tracking branch 'upstream/main' into fix-gh-138577
CuriousLearner Mar 21, 2026
6a59f3b
Address reviews
CuriousLearner Mar 22, 2026
d280ce9
fix: prevent prompt corruption during getpass echo_char line editing
CuriousLearner Mar 23, 2026
3f1a861
fix: disable IEXTEN in non-canonical mode to allow Ctrl+V (LNEXT) han…
CuriousLearner Mar 23, 2026
537392c
refactor: address review on getpass echo_char line editing
CuriousLearner Mar 23, 2026
e1e4aa3
fix: Add comments about ICANON and IEXTEN
CuriousLearner Mar 23, 2026
3e05fa3
Merge branch 'main' of github.com:python/cpython into fix-gh-138577
CuriousLearner Mar 23, 2026
90da605
Address reviews
CuriousLearner Mar 24, 2026
ef1efcb
Merge branch 'main' into fix-gh-138577
CuriousLearner Mar 24, 2026
a7c1de3
Remove prefix from private class methods
CuriousLearner Mar 24, 2026
78b2c6a
Merge branch 'fix-gh-138577' of github.com:CuriousLearner/cpython int…
CuriousLearner Mar 24, 2026
e1461a7
Merge branch 'main' of github.com:python/cpython into fix-gh-138577
CuriousLearner Mar 24, 2026
741a817
Apply suggestions from code review
vstinner Mar 24, 2026
cc5dc99
chore! update some documentation
picnixz Mar 29, 2026
0f5f5c8
fix! refresh screen on Ctrl+A/Ctrl-E
picnixz Mar 29, 2026
9d90dfa
refactor! use more handlers
picnixz Mar 29, 2026
3b2ae38
chore! reduce diff against `main`
picnixz Mar 29, 2026
919af5c
test: add cursor position tests for Ctrl+A/Ctrl+E in getpass echo_char
CuriousLearner Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: disable IEXTEN in non-canonical mode to allow Ctrl+V (LNEXT) han…
…dling
  • Loading branch information
CuriousLearner committed Mar 23, 2026
commit 3f1a86107f465c31a55f660af02e3473a5b41082
1 change: 1 addition & 0 deletions Lib/getpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def unix_getpass(prompt='Password: ', stream=None, *, echo_char=None):
term_ctrl_chars = None
if echo_char:
new[3] &= ~termios.ICANON
Comment thread
vstinner marked this conversation as resolved.
new[3] &= ~termios.IEXTEN
term_ctrl_chars = _get_terminal_ctrl_chars(fd)
tcsetattr_flags = termios.TCSAFLUSH
if hasattr(termios, 'TCSASOFT'):
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_getpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ def test_kill_ctrl_u_with_echo_char(self):
result = getpass._raw_input('Password: ', mock_output, mock_input,
'*')
self.assertEqual(result, expect_result)
# Should show "***" then clear all 3, then show "***" for "bar"
# Should show "***" then refresh to clear, then show "***" for "bar"
output = mock_output.getvalue()
self.assertIn('***', output)
# Should have backspaces to clear the "foo" part
self.assertIn('\b', output)
# Display refresh uses \r to rewrite the line including prompt
self.assertIn('\r', output)

def test_werase_ctrl_w_with_echo_char(self):
# Ctrl+W (WERASE) should delete the previous word
Expand Down
Loading