René's URL Explorer Experiment


Title: gh-138577: Fix keyboard shortcuts in getpass with echo_char by CuriousLearner · Pull Request #141597 · python/cpython · GitHub

Open Graph Title: gh-138577: Fix keyboard shortcuts in getpass with echo_char by CuriousLearner · Pull Request #141597 · python/cpython

X Title: gh-138577: Fix keyboard shortcuts in getpass with echo_char by CuriousLearner · Pull Request #141597 · python/cpython

Description: Fixes #138577 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. Tested with: import getpass # Test Ctrl+U (clear line) # Type "wrong", press Ctrl+U, type "correct" password = getpass.getpass(echo_char="*") print(f"Result: {password!r}") # Expected: 'correct' # Test Ctrl+W (erase word) # Type "hello world", press Ctrl+W, type "python" password = getpass.getpass(echo_char="*") print(f"Result: {password!r}") # Expected: 'hello python' # Test Ctrl+V (literal next) # Type "test", press Ctrl+V, press Ctrl+U, type "more" password = getpass.getpass(echo_char="*") print(f"Result: {password!r}") # Expected: 'test\x15more' (contains literal Ctrl+U) Issue: gh-138577 📚 Documentation preview 📚: https://cpython-previews--141597.org.readthedocs.build/

Open Graph Description: Fixes #138577 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 termina...

X Description: Fixes #138577 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...

Opengraph URL: https://github.com/python/cpython/pull/141597

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:09b6e55c-e496-3c49-68a1-b78425f7a954
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDC22:9F062:2A194FB:3BC59A0:6A51099A
html-safe-nonce3006c15ecebacd2b1d146c9a9c8c4a37f21ae3d804f629695a8778c6c1b7de68
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzIyOjlGMDYyOjJBMTk0RkI6M0JDNTlBMDo2QTUxMDk5QSIsInZpc2l0b3JfaWQiOiI2Nzg1MDMwMjU5MDA1Nzg2NTIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacffac81e39afaa6b5b1c9f83499c76ee887563d06c764ec744908737638d6ee39
hovercard-subject-tagpull_request:3013770110
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/141597/files
twitter:imagehttps://avatars.githubusercontent.com/u/8039608?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/8039608?s=400&v=4
og:image:altFixes #138577 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 termina...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2d129404fc45ea64edb1b98567c53e55b395536f
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/141597/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F141597%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F141597%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/141597/files
Reloadhttps://github.com/python/cpython/pull/141597/files
Reloadhttps://github.com/python/cpython/pull/141597/files
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
CuriousLearner:fix-gh-138577https://github.com/CuriousLearner/cpython/tree/fix-gh-138577
Conversation 67 https://github.com/python/cpython/pull/141597
Commits 21 https://github.com/python/cpython/pull/141597/commits
Checks 46 https://github.com/python/cpython/pull/141597/checks
Files changed https://github.com/python/cpython/pull/141597/files
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
gh-138577: Fix keyboard shortcuts in getpass with echo_char https://github.com/python/cpython/pull/141597/files#top
Show all changes 21 commits https://github.com/python/cpython/pull/141597/files
bb60653 gh-138577: Fix keyboard shortcuts in getpass with echo_char CuriousLearner Nov 15, 2025 https://github.com/python/cpython/pull/141597/commits/bb60653a826838b8072b87f11454ebd9bec798e4
31e35e4 Address reviews on dispatcher pattern + handle other ctrl chars CuriousLearner Nov 16, 2025 https://github.com/python/cpython/pull/141597/commits/31e35e4447f50851cd4ae7ea9d909ba441fe9ead
b8609bd Address reviews CuriousLearner Nov 30, 2025 https://github.com/python/cpython/pull/141597/commits/b8609bd4c3863f3cbf5ccf34cb33b350a94deca8
2691ad9 Merge remote-tracking branch 'upstream/main' into fix-gh-138577 CuriousLearner Mar 21, 2026 https://github.com/python/cpython/pull/141597/commits/2691ad9d6a47b4beee7b5f299d878b4ef36e830c
6a59f3b Address reviews CuriousLearner Mar 22, 2026 https://github.com/python/cpython/pull/141597/commits/6a59f3b083ae350c621aa5b80d0d6f087e15165c
d280ce9 fix: prevent prompt corruption during getpass echo_char line editing CuriousLearner Mar 23, 2026 https://github.com/python/cpython/pull/141597/commits/d280ce970ad96c6cd2ab69d9bd24735580764111
3f1a861 fix: disable IEXTEN in non-canonical mode to allow Ctrl+V (LNEXT) han… CuriousLearner Mar 23, 2026 https://github.com/python/cpython/pull/141597/commits/3f1a86107f465c31a55f660af02e3473a5b41082
537392c refactor: address review on getpass echo_char line editing CuriousLearner Mar 23, 2026 https://github.com/python/cpython/pull/141597/commits/537392c6525db029165643e914a735c97f691535
e1e4aa3 fix: Add comments about ICANON and IEXTEN CuriousLearner Mar 23, 2026 https://github.com/python/cpython/pull/141597/commits/e1e4aa3c99c9f196ffacf0a185448dfc33662989
3e05fa3 Merge branch 'main' of github.com:python/cpython into fix-gh-138577 CuriousLearner Mar 23, 2026 https://github.com/python/cpython/pull/141597/commits/3e05fa35e0562de54252dab4d09da002fc358393
90da605 Address reviews CuriousLearner Mar 24, 2026 https://github.com/python/cpython/pull/141597/commits/90da6057f9e83ff2444f93e8edc51b7c7a08a3c3
ef1efcb Merge branch 'main' into fix-gh-138577 CuriousLearner Mar 24, 2026 https://github.com/python/cpython/pull/141597/commits/ef1efcb0a9d6d94b8c2da9726c186ef5b81ee197
a7c1de3 Remove prefix from private class methods CuriousLearner Mar 24, 2026 https://github.com/python/cpython/pull/141597/commits/a7c1de380dfa102b64d373f34c083931ca6eaacf
78b2c6a Merge branch 'fix-gh-138577' of github.com:CuriousLearner/cpython int… CuriousLearner Mar 24, 2026 https://github.com/python/cpython/pull/141597/commits/78b2c6a7708e1cb967f26f631a41ea294b7a6b14
e1461a7 Merge branch 'main' of github.com:python/cpython into fix-gh-138577 CuriousLearner Mar 24, 2026 https://github.com/python/cpython/pull/141597/commits/e1461a70cdbd626c403840521ddd69321091ddac
741a817 Apply suggestions from code review vstinner Mar 24, 2026 https://github.com/python/cpython/pull/141597/commits/741a8177362d7bad96e180c4c606f525dd860503
cc5dc99 chore! update some documentation picnixz Mar 29, 2026 https://github.com/python/cpython/pull/141597/commits/cc5dc993c5659cc02e2e230d87cddc3143a1a29f
0f5f5c8 fix! refresh screen on Ctrl+A/Ctrl-E picnixz Mar 29, 2026 https://github.com/python/cpython/pull/141597/commits/0f5f5c81ad9f8eeeb7b0ca8c03ff19723ad7b57b
9d90dfa refactor! use more handlers picnixz Mar 29, 2026 https://github.com/python/cpython/pull/141597/commits/9d90dfad25b61e9aa2496fadee4a5c1b0d5f4fb8
3b2ae38 chore! reduce diff against `main` picnixz Mar 29, 2026 https://github.com/python/cpython/pull/141597/commits/3b2ae383f3f3f1b6fd0202500b6e3ae0091dd08f
919af5c test: add cursor position tests for Ctrl+A/Ctrl+E in getpass echo_char CuriousLearner Mar 30, 2026 https://github.com/python/cpython/pull/141597/commits/919af5c201381ac044a81b045487486b19121c0c
Clear filters https://github.com/python/cpython/pull/141597/files
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
getpass.rst https://github.com/python/cpython/pull/141597/files#diff-a539e906f12f8eb221f1d81caf82e4ceb2f0d5cf30b8505c73b6a366a5752bf4
getpass.py https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
test_getpass.py https://github.com/python/cpython/pull/141597/files#diff-acd0b3af44a7e1cb5c51d62ab92adeb8fdd3b16539f22703e8773d2f2a8cbf3f
2025-11-15-23-14-30.gh-issue-138577.KbShrt.rst https://github.com/python/cpython/pull/141597/files#diff-f3bca8ea13dd25cb8daa39ef86dbf9151910356dfa1432406dddc7ebc04dbf6e
Doc/library/getpass.rsthttps://github.com/python/cpython/pull/141597/files#diff-a539e906f12f8eb221f1d81caf82e4ceb2f0d5cf30b8505c73b6a366a5752bf4
View file https://github.com/CuriousLearner/cpython/blob/919af5c201381ac044a81b045487486b19121c0c/Doc/library/getpass.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/141597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/141597/files#diff-a539e906f12f8eb221f1d81caf82e4ceb2f0d5cf30b8505c73b6a366a5752bf4
https://github.com/python/cpython/pull/141597/files#diff-a539e906f12f8eb221f1d81caf82e4ceb2f0d5cf30b8505c73b6a366a5752bf4
Lib/getpass.pyhttps://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
View file https://github.com/CuriousLearner/cpython/blob/919af5c201381ac044a81b045487486b19121c0c/Lib/getpass.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/141597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
picnixzhttps://github.com/picnixz
Mar 29, 2026https://github.com/python/cpython/pull/141597/files#r3006104845
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
https://github.com/python/cpython/pull/141597/files#diff-3bde66c820a115e5740d481232a0c48331c3856ad4c247a586be98991c08f8cb
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
Please reload this pagehttps://github.com/python/cpython/pull/141597/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.