Skip to content

Stop waiting for input after invalid bytes in a closed literal - #1278

Merged
st0012 merged 1 commit into
masterfrom
claude/project-thread-9tjzlo
Nov 15, 2026
Merged

st0012 merged 1 commit into
masterfrom
claude/project-thread-9tjzlo

Conversation

@st0012

@st0012 st0012 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

With Prism 2.x, IRB waits for more input after code like :"\xAE" or /\xAE/. The user can not finish the expression, so IRB looks stuck. With this change, IRB evaluates the code and shows the error.

Prism 2.x returns continuable? == true when the only errors are invalid bytes in a finished literal (invalid_symbol, invalid_multibyte_escape, invalid_multibyte_character). More input can not fix these errors. check_code_syntax now returns :unrecoverable_error when every error is one of them. If the literal is still open, like :"\xAE, IRB still waits for input.

This also fixes the master CI failure on Ruby 2.7 to 3.2. CI started to resolve prism 2.1.0, and test_evaluate_with_encoding_error_without_lineno timed out. That test only runs on Ruby < 3.3, so the new unit test checks check_code_syntax directly on every Ruby.

Prism 2.x reports `continuable? == true` when the only errors are invalid
bytes in a finished literal, like `:"\xAE"` or `/\xAE/`. More input can
not fix these errors, but IRB trusted the flag and waited for the next
line forever.

Treat the code as an unrecoverable error when every error is one of
these invalid literal errors.
@st0012
st0012 merged commit 378cedc into master Nov 15, 2026
80 checks passed
@st0012
st0012 deleted the claude/project-thread-9tjzlo branch November 15, 2026 17:47
@st0012 st0012 added the bug Something isn't working label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant