Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable Rails console IRB's autocompletion in production
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`
- Loading branch information