Skip to content

gh-152068: Reset PyREPL Colors on prompt finish#152108

Merged
pablogsal merged 9 commits into
python:mainfrom
edvilme:gh-152068-pyrepl-color-bug
Jul 4, 2026
Merged

gh-152068: Reset PyREPL Colors on prompt finish#152108
pablogsal merged 9 commits into
python:mainfrom
edvilme:gh-152068-pyrepl-color-bug

Conversation

@edvilme

@edvilme edvilme commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Fixes a bug when a line was split (particularly on macOS Terminal.app) in the middle of a colorized keyword, causing the ANSI Color Reset sequence (\x1b[0m) to not be properly printed, causing the output to be colored when it shouldn't.

Before and after

Screenshot 2026-06-24 at 7 57 42 p m

CC @StanFromIreland

@brettcannon brettcannon self-requested a review July 1, 2026 02:43
Comment thread Lib/_pyrepl/unix_console.py
edvilme and others added 2 commits July 2, 2026 10:48
…mJU.rst

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@edvilme edvilme force-pushed the gh-152068-pyrepl-color-bug branch from 0c56e5d to d54cfb8 Compare July 2, 2026 19:23
@edvilme edvilme requested a review from terryjreedy as a code owner July 2, 2026 19:23
@edvilme edvilme force-pushed the gh-152068-pyrepl-color-bug branch from d54cfb8 to 529de59 Compare July 2, 2026 19:24
…estore()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edvilme edvilme requested a review from pablogsal July 2, 2026 20:42

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks for the PR!

@pablogsal pablogsal added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes and removed needs backport to 3.14 bugs and security fixes labels Jul 4, 2026
@pablogsal pablogsal merged commit 832d557 into python:main Jul 4, 2026
72 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @edvilme for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @edvilme and @pablogsal, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 832d5571115fba0adcb09742b56f51ee081710c6 3.14

@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

GH-153029 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.14 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants