Ruby

Ruby’s irb (Interactive Ruby) has syntax highlighting since Ruby 3.x. The quickest way to use it is with the built-in profile:

extensions:
  term:
    profile: ruby

This sets shell: irb, shell-args: ["--noecho", "--nomultiline"], prompt: "irb>", and ps2: "irb*". For modern irb with numbered prompts, you’ll want to override with regex-based prompt detection and add strip-auto-indent:

extensions:
  term:
    profile: ruby
    shell-args: ["--noautocomplete"]
    prompt-regex: "`irb\\(main\\):\\d+>\\s*$`"
    ps2-regex: "`irb\\(main\\):\\d+[*|]\\s*$`"
    strip-auto-indent: true

The strip-auto-indent option counteracts irb’s automatic indentation of continuation lines.

Basic Usage

Expressions

Arrays and Hashes

Methods

Blocks and Iterators