GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enable error overlays in the REPL · Issue #148228 · python/cpython

Enable error overlays in the REPL #148228

New issue
Copy link
New issue
Copy link
Closed
Closed
Enable error overlays in the REPL#148228
Copy link
Assignees
johnslavik
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement

Description

@johnslavik
johnslavik
opened on Apr 7, 2026
Issue body actions

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:

https://github.com/search?q=repo%3Apython%2Fcpython%20%2F(reader%7Cr)%5C.error%2F%20path%3ALib%2F_pyrepl&type=code

I think displaying some of these could be a nice feature.

The best example is:

cpython/Lib/_pyrepl/completing_reader.py

Lines 190 to 193 in 4f68c04

completions = r.cmpltn_menu_choices
if not completions:
if not r.cmpltn_action:
r.error("no matches")

Compare current vs proposed (enabled + colorized):

Screen.Recording.2026-04-07.at.19.04.58.mov

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.

Screen.Recording.2026-04-07.at.19.08.58.mov

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-148228: Enable error overlays in the REPL #148229
  • gh-148228: Render REPL error overlays in brackets and non-bold red #160008
Reacted by Chris Eibl
Reacted by Łukasz Langa and Eduardo Villalpando Mello

Activity

  1. johnslavik
    self-assigned this
    on Apr 7, 2026
  2. johnslavik
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-replRelated to the interactive shellRelated to the interactive shell
    on Apr 7, 2026
  3. johnslavik commented on Apr 7, 2026

    @johnslavik
    johnslavik
    on Apr 7, 2026
    MemberAuthor
    More actions

    whereas now it is impossible to distinguish these two states.

    The suppressing method skips console.beep() too, and that's what the proposal enables as well.

  4. johnslavik
    changed the title [-]Enable error overlays in the Python REPL[/-] [+]Enable error overlays in the REPL[/+] on Apr 8, 2026
  5. ambv
    added a commit that references this issue on Oct 20, 2026

    gh-148228: Enable error overlays in the REPL (GH-148229)

    f5bd077
  6. johnslavik
    closed this as completedon Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @johnslavik
    johnslavik

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.