Enable error overlays in the REPL
@johnslavik is already working on this.
Since Apr 7, 2026.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
Under the trend of improving Python diagnostic messages, I propose we enable the Python REPL error messages (disabled since the PyPy era). There are at least 19 places among various REPL commands where we do log errors, but never display them to the user:
I think displaying some of these could be a nice feature.
The best example is:
Compare current vs proposed (enabled + colorized):
https://github.com/user-attachments/assets/65f041de-d9c8-4183-8d19-242fa09473a0
Given that we already use overlays for completions, I propose we review errors that we could propagate to the user and open up cool possibilities (we can put "tips" there, we can bundle Levenshtein if tab misses something, if it makes sense). Having this makes it clear when the REPL actually receives keyboard shortcuts but can't do anything with them vs when the keyboard shortcut was incorrect, whereas now it is impossible to distinguish these two states.
https://github.com/user-attachments/assets/a47ee38e-858e-4cb4-afa0-2acc5b8569db
Some of these errors may feel noisy/unclear if the user accidentally presses something, but we can make them easier to understand by attaching context about what key binds were pressed or silencing some errors (e.g. creating .debug() besides .error() and resorting to that one. Then maybe turn this on with an environment variable, etc.).
Feel free to play with the PR to stress-test this.
Digressing a bit, this could turn into something interesting, e.g. we could have a similar overlay for displaying tips with a beautiful 💡 emoji or a "what's new" if we add some new stuff to the REPL. (No, I will never suggest adding LLM snake pets to the REPL. Never.)
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
- gh-148229
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.
Assessment
This issue has not been assessed yet.