irb
irb copied to clipboard
Add start up message
When starting IRB directly, it could be helpful to users to have a few information printed, like:
- Ruby version
- Reline version?
- Minimum instructions, like how to get help or exit the session
Requirements
- It should be printed when IRB is started with the
irbcommand - It should NOT be printed when
binding.irbis called - It should NOT be printed when Rails console is invoked
- There should be a way to disable it
- I prefer env var over
IRB.confon this
- I prefer env var over
Examples
$ be irb
IRB 1.7.4 (Ruby 3.2.2, Reline 0.3.8)
Help: show_cmds
Exit: exit or Ctrl-D
irb(main):001>
I would add a newline gap between the startup and the prompt, otherwise yes!
I think it is good! I will share my concerns.
I think the importance for users is Ruby version > IRB version > Reline version.
irb_info may be sufficient since IRB and Reline versions are important mainly for issue reporting.
I think it is better to reduce the number of lines as much as possible since it is displayed at every startup. 2 lines seemed to be enough for Python and Node.js. Personally, I thought that exit might be unnecessary.
$ node
Welcome to Node.js v20.5.1.
Type ".help" for more information.
>
$ python
Python 3.11.4 (main, Jun 20 2023, 16:59:59) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
Do we need to discuss this at https://bugs.ruby-lang.org/ ?
By the way,
- There should be a way to disable it
- I prefer env var over IRB.conf on this
I prefer IRB.conf. And, command line option like Python.
% python3 -q
>>>
@ima1zumi
I think the importance for users is Ruby version > IRB version > Reline version.
Yeah I agree. We can start with just the Ruby version.
Personally, I thought that exit might be unnecessary.
Ok let's just display show_cmds first 👍
@elfham
Do we need to discuss this at https://bugs.ruby-lang.org/ ?
I prefer IRB.conf.
Do you mind explaining the reason?
And, command line option like Python.
Yeah I can see some users requesting it.
Do we need to discuss this at https://bugs.ruby-lang.org/ ?
Since many Ruby users run irb many times a day, this change does not seem so small, so I thought more people (e.g. ruby-core) should be aware of this change.
I prefer IRB.conf.
Environment variables need to be set in several files, such as bashrc, zshrc, profile, and so on. Therefore, it would be good if they could be consolidated in irbrc.
The best thing is that env, irbrc, and option can all be set.