From 348843186d458c24637a1f0f61428c34967007e9 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 24 Jul 2026 17:40:38 -0500 Subject: [PATCH] Add IRB Prints A Helpful Welcome Prompt as a Ruby TIL --- README.md | 3 ++- ruby/irb-prints-a-helpful-welcome-prompt.md | 27 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 ruby/irb-prints-a-helpful-welcome-prompt.md diff --git a/README.md b/README.md index 29b4eb2..3c47ccc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1834 TILs and counting..._ +_1835 TILs and counting..._ See some of the other learning resources I work on: @@ -1510,6 +1510,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Install Latest Version Of Ruby With asdf](ruby/install-latest-version-of-ruby-with-asdf.md) - [Invoking Rake Tasks Multiple Times](ruby/invoking-rake-tasks-multiple-times.md) - [IRB Has Built-In Benchmarking With Ruby 3](ruby/irb-has-built-in-benchmarking-with-ruby-3.md) +- [IRB Prints A Helpful Welcome Prompt](ruby/irb-prints-a-helpful-welcome-prompt.md) - [Join URI Path Parts](ruby/join-uri-path-parts.md) - [Jump Out Of A Nested Context With Throw/Catch](ruby/jump-out-of-a-nested-context-with-throw-catch.md) - [Last Raised Exception In The Call Stack](ruby/last-raised-exception-in-the-call-stack.md) diff --git a/ruby/irb-prints-a-helpful-welcome-prompt.md b/ruby/irb-prints-a-helpful-welcome-prompt.md new file mode 100644 index 0000000..4fdffd7 --- /dev/null +++ b/ruby/irb-prints-a-helpful-welcome-prompt.md @@ -0,0 +1,27 @@ +# IRB Prints A Helpful Welcome Prompt + +I've been using `irb` for over 15 years as a REPL for executing Ruby code. It +has always been pretty plain in a lot of ways. For this reason, I often used +[`pry`](https://github.com/pry/pry) instead, especially in a Rails context. +`irb` has gotten notably better in recent years. I was delighted to recently +notice that earlier this year they landed delightful, colorful, and helpful +improvement to the welcome prompt. + +It looks more or less like this: + +``` +❯ irb + +⢀⡴⠊⢉⡟⢿ IRB v1.18.0 - Ruby 3.4.4 +⣎⣀⣴⡋⡟⣻ "ls [object] -g pattern" to filter methods and properties +⣟⣼⣱⣽⣟⣾ ~/dev/jbranchaud/pool-league-pro + +irb(main):001> +``` + +Notice it includes a random tip on the second line. I had no idea you could +include `-g pattern` with an `ls`, so that will likely be landing as a new TIL +soon. + +This improved welcome message has been available since `1.18.0` and originated +in [this PR](https://github.com/ruby/irb/pull/1183).