Skip to content

irb 1.18.0 with its startup banner, naming IronRuby; UTF-8 in the Windows console - #70

Merged
Largo merged 4 commits into
masterfrom
irb/1.18
Oct 30, 2026
Merged

Largo merged 4 commits into
masterfrom
irb/1.18

Conversation

@Largo

@Largo Largo commented Oct 30, 2026

Copy link
Copy Markdown
Owner

irb 1.18 opens with a banner: the small Ruby logo, IRB v1.18.0 - Ruby <version>, a tip and the current directory. CRuby shows it as soon as irb 1.18 is installed over the bundled 1.16.0. IronRuby vendored 1.16.0, so it had no banner.

Changes

  • Src/StdLib/ruby/4.0/irb and irb.rb are now irb 1.18.0's lib/, copied verbatim, together with its LICENSE.txt.
  • The default gemspec, VERSION.txt, the note in install-bundled-gems.rb and the README now say 1.18.0. That is newer than CRuby 4.0.9's bundled irb, as repl_type_completor already is. reline stays at 0.6.3, which irb 1.18 accepts.
  • irb shows the banner only when started through a path ending in exe/irb. Src/StdLib/bin/irb therefore passes that path. It covers ir -S irb, iirb and ironruby at a terminal; irb uses only the basename.

Checked

  • irb 1.18 finds open nestings with Prism instead of Ripper. On IronRuby's prism 2.0.0, NestingParser.open_nestings gives CRuby's results for complete and unfinished def, do, case/in, if and class.
  • A piped ir -S irb session with a multi-line def runs, shows the banner and reports 1.18.0.
  • irb still picks TypeCompletor.
  • Not done: an interactive session in a real console (Tab, the multi-line prompt while typing).

gen-default-gemspecs.rb would also rewrite five unrelated gemspecs (ffi, fiddle, nokogiri, psych, puma), because the committed tree has drifted from the generator. They are not part of this PR.

irb 1.18 opens with a banner - the small Ruby logo, "IRB v1.18.0 - Ruby
<version>", a tip and the current directory - which CRuby shows once irb 1.18
is installed over the 1.16.0 it bundles. IronRuby vendored 1.16.0, verbatim,
so it had none.

Src/StdLib/ruby/4.0/irb and irb.rb are now irb 1.18.0's lib/, verbatim, with
its LICENSE.txt; the default gemspec, VERSION.txt, install-bundled-gems.rb's
note and the README say 1.18.0. This is newer than CRuby 4.0.9's bundled irb,
as repl_type_completor is; reline stays 0.6.3, which irb 1.18 accepts.

irb shows the banner only when started through a path ending in exe/irb, the
gem's executable that MRI's binstub loads. Src/StdLib/bin/irb, which `ir -S
irb`, iirb and `ironruby` at a terminal run, passes that path; irb takes only
its basename from it.

irb 1.18 finds open nestings with Prism instead of Ripper. On IronRuby's prism
2.0.0 it gives CRuby's answers for complete and unfinished def, do, case/in,
if and class inputs; a piped `ir -S irb` session with a multi-line def runs,
shows the banner and reports 1.18.0, and the TypeCompletor is still chosen.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3da41248-82de-485d-a80c-d51fc5e5c597
Commits

Reviewing files that changed from the base of the PR and between b98aaa8 and 29b4967.

Files selected for processing: 26
  • README.md
  • Src/Ruby/Builtins/ConsoleStream.cs
  • Src/StdLib/bin/irb
  • Src/StdLib/ruby/4.0/VERSION.txt
  • Src/StdLib/ruby/4.0/irb.rb
  • Src/StdLib/ruby/4.0/irb/color.rb
  • Src/StdLib/ruby/4.0/irb/command/base.rb
  • Src/StdLib/ruby/4.0/irb/command/copy.rb
  • Src/StdLib/ruby/4.0/irb/command/internal_helpers.rb
  • Src/StdLib/ruby/4.0/irb/command/ls.rb
  • Src/StdLib/ruby/4.0/irb/completion.rb
  • Src/StdLib/ruby/4.0/irb/context.rb
  • Src/StdLib/ruby/4.0/irb/debug.rb
  • Src/StdLib/ruby/4.0/irb/init.rb
  • Src/StdLib/ruby/4.0/irb/input-method.rb
  • Src/StdLib/ruby/4.0/irb/nesting_parser.rb
  • Src/StdLib/ruby/4.0/irb/pager.rb
  • Src/StdLib/ruby/4.0/irb/ruby-lex.rb
  • Src/StdLib/ruby/4.0/irb/ruby_logo.aa
  • Src/StdLib/ruby/4.0/irb/source_finder.rb
  • Src/StdLib/ruby/4.0/irb/startup_message.rb
  • Src/StdLib/ruby/4.0/irb/version.rb
  • Src/StdLib/ruby/gems/4.0.0/gems/irb-1.18.0/exe/irb
  • Src/StdLib/ruby/gems/4.0.0/specifications/default/irb-1.18.0.gemspec
  • Util/gen-default-gemspecs.rb
  • Util/install-bundled-gems.rb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Largo added 3 commits October 30, 2026 01:17
gen-default-gemspecs.rb writes each default gem's executables as one-line
loaders into gems/<name>-<version>/exe, where Gem.bin_path looks; the irb one
moves from irb-1.16.0 to irb-1.18.0 with the version. The loader itself is
unchanged.
irb 1.18's startup banner says "Ruby #{RUBY_VERSION}", which on IronRuby read
"Ruby 4.0.0" - the language version, not the interpreter running. It now says
"IronRuby <IRONRUBY_VERSION> (<RUBY_VERSION>)", as RUBY_DESCRIPTION does; on
any other Ruby the line is upstream's. Patched in place in the vendored
irb/startup_message.rb and listed in VERSION.txt with the other patches.
…MRI does

$stdout and $stderr handed Ruby's bytes to .NET's console stream, which passes
them to WriteFile, and a console reads those in its output code page - 850 or
437 on most machines - so everything outside ASCII was mojibake: "ä" as two
characters, and irb 1.18's banner logo as "ÔóÇÔí...".

MRI writes to a console with WriteConsoleW. When standard output or error is a
console (GetConsoleMode succeeds), IronRuby now decodes the bytes as UTF-8,
Ruby's default external encoding on Windows, and writes them the same way; a
character split across two writes is held until its last byte arrives.
Redirected to a file or a pipe, the bytes go out unchanged, as before.

Checked in a fresh conhost window with output code page 850, reading the
screen back with ReadConsoleOutputCharacterW: "äöü ß €" and the banner's
braille logo show as written. Redirected, the file holds the UTF-8 bytes.
@Largo Largo changed the title irb 1.18.0, with its startup banner irb 1.18.0 with its startup banner, naming IronRuby; UTF-8 in the Windows console Oct 30, 2026
@Largo
Largo merged commit 259df02 into master Oct 30, 2026
8 checks passed
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.

1 participant