Line-wrapped syntax highlighting in Python shell spills over into program output
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
As shown here, when I make the input long enough that the range gets wrapped with a backtick, all subsequent lines until the next command prompt become the same cyan as the text of range.
Tangentially, is there any way to have Python itself stop doing this when the VScode terminal already did it for me in a way I find preferable (since it doesn't insert line-breaks into long one-liners copied from the shell)?
issue 140334 is similar, but this affects the shell, not just IDLE.
CPython versions tested on:
3.14
Operating systems tested on:
macOS, in both VScode and the terminal.
Linked PRs
- gh-152108
- gh-153029
- gh-154402
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the wrapped input in Python 3.14 using the macOS terminal and VS Code, then compare the behavior with issue 140334. Trace the Python shell's syntax-highlighting handling and verify that program output after a wrapped command no longer inherits the input color; linked PRs gh-152108, gh-153029, and gh-154402 indicate work is already underway.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100