From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2025-03-18T01:28:08+00:00 Subject: [ruby-core:121390] [Ruby Bug#21188] PRISM does not end reading from tty with ^D twice Issue #21188 has been reported by nobu (Nobuyoshi Nakada). ---------------------------------------- Bug #21188: PRISM does not end reading from tty with ^D twice https://bugs.ruby-lang.org/issues/21188 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Assignee: prism * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED ---------------------------------------- When reading from tty, `^D` ends the text without the newline. ```console $ cat a ``` Typing `^D` here, only "a" is sent without a newline, and `cat` echos back it. Then by typing `^D` again, an empty read that means EOF causes `cat` to exit. `ruby --parser=parse.y` behaves in this manner: ```console $ ruby --parser=parse.y p __FILE__"-" ``` Typing `^D` twice just after `__FILE__`, and `p` prints `"-"`. However prism requires `^D` thrice. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/