ruby / irb

interactive Ruby
BSD 2-Clause "Simplified" License
392 stars 119 forks source link

Disable autocompletions by default #1020

Closed jedrekdomanski closed 1 month ago

jedrekdomanski commented 1 month ago

Breakdown of the change:

Behavior after the change:

This way, users won’t need to set the environment variable to disable autocomplete; it will be disabled by default.

Note:

Users can still run irb with extra flags to control autocomplete:

st0012 commented 1 month ago

Why should autocomplete be disabled by default? Please list specific issues that you think are outweighing the benefits to help us understand the root problems.

jedrekdomanski commented 1 month ago

Why should autocomplete be disabled by default? Please list specific issues that you think are outweighing the benefits to help us understand the root problems.

The current configuration requires users to either create an .irbrc file on every server and manually disable autocomplete with:

IRB.conf[:USE_AUTOCOMPLETE] = false

in every project, or explicitly set the IRB_USE_AUTOCOMPLETE environment variable on each server across all projects. This can become cumbersome to manage, especially in environments with multiple servers or projects.

Additionally, the autocomplete feature has a significant performance impact. It tends to be slow, which negatively affects the user experience when typing commands in the console. The prompt often displays all possible methods and suggestions, which can drastically slow down typing and execution. The autocomplete UI itself is invasive and distracting, which detracts from a smooth console workflow.

There are reports of dissatisfaction with this default behavior, as seen in IRB issue #351. This PR aims to address these concerns by making the behavior more user-friendly and less intrusive by default. Users who prefer autocomplete can still enable it easily, but it won't be forced on everyone, improving overall usability.

st0012 commented 1 month ago

The problems mentioned in #351 have mostly been addressed in both IRB and Reline, such as:

Unless you can prove or convince us that most of the Ruby developers using the latest IRB and Reline are still suffering the problem and actively seeking a way to disable autocompletion, turning it off by default is a massive breaking change that'd require many users to enable it manually. Therefore, we will not make this decision lightly.

If you're seeing those issues because you're not using the latest IRB and Reline (e.g. using the default in Ruby 3.1), then this PR won't help it anyway.