Rails 7 console auto completion makes it unusable

Since I upgraded to Rails 7, whenever I type something on the rails console, I get a window with the possible auto completion possibilities.

That’s nice if it wasn’t that slow. Typing in characters is not that slow, but pressing the backspace key allow me on average to remove one character per second. If I press the backspace key more than that, it gets ignored. it is really annoying

Is there a way to disable auto completion ? Escape character does not let me close the completion box.

2 Likes

Had that same problem. Just do this:

echo 'IRB.conf[:USE_AUTOCOMPLETE] = false' >> ~/.irbrc
6 Likes

I ran into the same situation. The idea is nice but it’s just unusable. It also makes the terminal very jumpy and it’s easier to loose focus on the pointer. It gets even worse when I start a new string and paste a few thousand lines, it nearly crashes.

If you using IRB remotely and do not have permission to update .irbrc file, try this:

Reline.autocompletion = IRB.conf[:USE_AUTOCOMPLETE] = false

This assignment changes the behaviour of the current session.

May the source be with you.

1 Like

Good answers thusfar. Here’s another option to disable auto-complete just for this run only:

bin/rails c -- --nomultiline

+1 here It’s so annoying, it also cuts the part of the previous inputs in console

If you are using Heroku, you should be able to create an .irbrc in your app’s root and check that in. When you do heroku run bin/rails c, it’ll pick that up and avoid using it.

Your situation doesn’t reproduce on my environment. Perhaps you’re using too old versions of irb / reline? I suggest you all to run

$ bundle up irb reline

and try again, instead of trying to disable irb’s wonderful new features.

FWIW, I just updated both and the completion locally is unusable due to white on light blue color scheme. I looked at the repos for IRB and reline and cannot see how these colors can be changed. If anyone knows how, let me know and I will test + try to make a doc change in one of these projects

Should be relevant https://github.com/ruby/reline/pull/413

Nothing in there worked for me, so either the changes haven’t been released or I was not able to understand what to do. It’s possible that using the branches discussed in a few comments would work