From: Daniel Luz Date: 2008-09-09T12:33:00+09:00 Subject: [ruby-core:18513] Make irb start a new line on EOF ------=_Part_59841_3098539.1220931555477 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Other interactive interpreters (namely `python`, `lua`, `psh`, and SpiderMonkey's `js`) emit a newline before exiting when fed an EOF (^D). This is a nice feature, as it makes your usual shell prompt start on its own line rather than appear on the same line as the interactive interpreter's prompt when you leave by pressing ^D, for instance. Any reason for irb not to do the same? I tried to make it behave as I wished, and the attached patch is the trivial solution I found. I should note, though, that I'm not familiarized with irb's source code, and this was a very quick hack; maybe this isn't the best place to implement the changes then. The patch is for the ruby_1_8_7 branch, by the way; on Ruby 1.9, it seems to be one line off. -- Daniel Luz ------=_Part_59841_3098539.1220931555477 Content-Type: text/x-diff; name=irb-newline.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_fkvz3pm31 Content-Disposition: attachment; filename=irb-newline.patch LS0tIGxpYi9pcmIucmIJMjAwOC0wMi0wOCAxMzo0NDo1NC4wMDAwMDAwMDAgLTAzMDAKKysrIGxp Yi9pcmIucmIJMjAwOC0wOS0wOSAwMDozNDozNy4wMDAwMDAwMDAgLTAzMDAKQEAgLTEzNSwxMCAr MTM1LDEyIEBACiAJICAgIGlmIEBjb250ZXh0Lmlnbm9yZV9lb2Y/IGFuZCBAY29udGV4dC5pby5y ZWFkYWJsZV9hdGZlcl9lb2Y/CiAJICAgICAgbCA9ICJcbiIKIAkgICAgICBpZiBAY29udGV4dC52 ZXJib3NlPwogCQlwcmludGYgIlVzZSBcImV4aXRcIiB0byBsZWF2ZSAlc1xuIiwgQGNvbnRleHQu YXBfbmFtZQogCSAgICAgIGVuZAorCSAgICBlbHNlCisJICAgICAgcHJpbnQgIlxuIgogCSAgICBl bmQKIAkgIGVuZAogCSAgbAogCWVuZAogICAgICAgZW5kCg== ------=_Part_59841_3098539.1220931555477--