-
Notifications
You must be signed in to change notification settings - Fork 121
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
Allow disabling autocompletion with IRB_USE_AUTOCOMPLETE=false
#469
Conversation
USE_AUTOCOMPLETE=false
to disable autocompletionUSE_AUTOCOMPLETE=false
ab6fe42
to
4cf3b42
Compare
cc @k0kubun |
It depends. I like that you chose a name consistent with irbrc, but when it comes to environment variables, I would choose a name that includes
How will it be easier to know of this environment variable than
If it's that problematic, we might want to consider disabling it by default until all the issues are addressed. The most annoying part of auto-completion for me is the fact that the prompt position randomly moves depending on the completion size when you're at the bottom of the window, but currently nobody even discusses it maybe because there are more annoying problems for other people. I appreciate that reline-powered IRB supports multi-line editing and can be used like an editor, but I still use one-liner inputs on IRB most of the time. It's never easier to edit a multi-line long script on reline than your own actual editor. If you mostly use a one-liner, it feels more like a normal REPL than an editor. It's normal to have auto-completion on an editor, but not on a REPL. While it might be useful for some people to have this capability, I don't think this needs to be enabled by default, especially when it's a factor that annoys IRB users. |
We can use the same prefix convention
I think I should phrase it differently: in my experience, env var is a common way to control features like this (such as
I thought about it before. But based on my polling result in #445, we have around 28% of users satisfied with it as it is today. And only 17% of them dislike it enough to disable it. So if we disable it now, it'd be a breaking change for the 28% of users, which is a big number. Therefore, I think we should keep it enabled, but also make it easier to disable. That's why I want to propose this env var. |
Fair enough.
It makes sense that debug.gem needs to start it with |
4cf3b42
to
a7dfd1b
Compare
|
USE_AUTOCOMPLETE=false
IRB_USE_AUTOCOMPLETE=false
56e4194
to
1ffaeca
Compare
Currently, the only 2 ways to disable autocompletion are: 1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false` 2. Add the `--noautocomplete` flag when using the `irb` executable Both of them are less convenient than setting a env var and are lesser known to devs. And given the number of problems the autocompletion has (see ruby#445), I think we should allow disabling it with a simple `IRB_USE_AUTOCOMPLETE=false`.
1ffaeca
to
0547fa3
Compare
`IRB_USE_AUTOCOMPLETE=false` (ruby/irb#469) * Allow using IRB_USE_AUTOCOMPLETE=false to disable autocompletion Currently, the only 2 ways to disable autocompletion are: 1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false` 2. Add the `--noautocomplete` flag when using the `irb` executable Both of them are less convenient than setting a env var and are lesser known to devs. And given the number of problems the autocompletion has (see #445), I think we should allow disabling it with a simple `IRB_USE_AUTOCOMPLETE=false`. * Mention some env var configs in the README
Reasons behind this change: 1. Autocompletion increases data transmission significantly. This could cause noticeable slowdown when connecting to remote servers, which is usually the case in production. 2. The autocompletion feature still has many issues, as listed in ruby/irb#445. They may be just annoying when happened locally, but in production they could cause real issues (e.g. typos caused by slow backspacing). Due to these reasons, I think it's safer to disable this feature in production. About the implementation: Because `IRB.start` doesn't take configuration arguments and rebuilds the `IRB.conf` object, the only way we can turn off autocompletion is through the `IRB_USE_AUTOCOMPLETE` env var. The env var was added in ruby/irb#469 and will be available for IRB 1.6+ and Ruby 3.2+. The name wasn't used before so it won't cause issues with older IRB versions. Note: Users can still turn it back on with `IRB_USE_AUTOCOMPLETE=true`
Currently, the only 2 ways to disable autocompletion are:
.irbrc
and setIRB.conf[:USE_AUTOCOMPLETE] = false
--noautocomplete
flag when using theirb
executableBoth of them are less convenient than setting a env var and are lesser known to devs.
And given the number of problems the autocompletion has (see #445), I think we should allow disabling it with a simple
IRB_USE_AUTOCOMPLETE=false
.