Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add start up message #687

Open
st0012 opened this issue Aug 20, 2023 · 5 comments
Open

Add start up message #687

st0012 opened this issue Aug 20, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@st0012
Copy link
Member

st0012 commented Aug 20, 2023

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 irb command
  • It should NOT be printed when binding.irb is 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.conf on this

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> 
@st0012 st0012 added the enhancement New feature or request label Aug 20, 2023
@zzak
Copy link
Member

zzak commented Aug 21, 2023

I would add a newline gap between the startup and the prompt, otherwise yes!

@ima1zumi
Copy link
Member

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.
>>>

@elfham
Copy link

elfham commented Aug 22, 2023

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
>>>

@st0012
Copy link
Member Author

st0012 commented Aug 24, 2023

@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.

@elfham
Copy link

elfham commented Aug 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants