Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Feb 12, 2025

Reline::ANSI have a read buffer. We don't need to write read bytes back to STDIN only in a few case.

@buf #=> [A, B, C]
@output << "\e[6n"
stdin.read_partial #=> "DE" + "\e[ROW;COLUMNR" + "FG"
@buf.concat ("DE" + "FG").bytes
@buf #=> [A, B, C, D, E, F, G]

Background

This will reduce the effort (example: kateinoigakukun/irb.wasm#24) of making Reline work with wasm

Copy link
Member

@ima1zumi ima1zumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ima1zumi ima1zumi merged commit 70212fa into ruby:master Feb 15, 2025
42 of 44 checks passed
@tompng tompng deleted the no_stdin_ungetc branch February 15, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants