Skip to content

Instantly share code, notes, and snippets.

View rwcitek's full-sized avatar

Robert Citek rwcitek

View GitHub Profile
@edhowland
edhowland / ruby_reline_leaves_voice_over_and_terminal_in_bad_state.md
Last active March 10, 2023 21:11
Ruby Reline module leaves Terminal in bad state after the last thing was a print without a newline affecting MacOS VoiceOver screenreader users

If using a screenreader like VoiceOver for the Mac and you use Reline.readmultiline , for example in a loop , say in a REPL, and you output a string without terminating the line with a newline, funny things happen to your screenreader. Like, it no longer outputs the characters you type.

This can be easily demonstrated using Docker and 2 images: ruby:2.6 and ruby:3.2 In ruby:2.6 and before, the same program 'irb', Ruby's own REPL does not experience this problem. But in Ruby 2.7 and above, irb was changed to use the new Reline module instead of the venerable Readline, a wrapper around the venerable GNU readline library.