gh-148228: Enable error overlays in the REPL#148229
Open
johnslavik wants to merge 10 commits into
Open
Conversation
johnslavik
requested review from
ambv,
hugovk,
lysnikolaou and
pablogsal
as code owners
April 7, 2026 17:23
pablogsal
reviewed
Apr 24, 2026
pablogsal
reviewed
Apr 24, 2026
| t = THEME() | ||
| error_prefix = f"{t.error}{error_prefix}{t.reset}" | ||
| self.console.beep() | ||
| self.msg = error_prefix + msg |
Member
There was a problem hiding this comment.
Maybe I am misreading this flow but if I am not wrong, the error() now embeds the escape sequences into self.msg. The message renderer at _render_message_lines slices by string length, not visible width. Then, len(message_line) counts the ANSI bytes (\x1b[1;31m ... \x1b[0m), so on narrow terminals (or long error messages) the slice boundary can land mid-escape, producing a truncated \x1b[ on one line and stray m on the next leaving the whole line un-colored or visually corrupted.
Member
Author
pablogsal
reviewed
Apr 24, 2026
Documentation build overview
19 files changed ·
|
johnslavik
force-pushed
the
enable-error-overlays
branch
from
July 20, 2026 22:55
1d02b0f to
8cb9bc0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small proof of concept for gh-148228. We can build on this further on.