inf-ruby icon indicating copy to clipboard operation
inf-ruby copied to clipboard

inf-ruby-get-old-input: Search failed:

Open nfedyashev opened this issue 2 years ago • 9 comments

Any tips on how to fix my Rails repl is greatly appreciated.

I've been using inf-ruby for a long time but something broke after I reinstalled my OS. The issue is that I can't execute any command by typing it and pressing Enter.

I mean, typing works but Enter doesn't execute it.

console-enter

I've tried various ways of using ruby-send-*, same result.

When I'm in repl buffer and I press Enter(or execute comint-send-input), the following message is printed in Messages buffer

inf-ruby-get-old-input: Search failed: "\(^>> *\)\|\(^(rdb:1) \)\|\(^(byebug) \)\|\(^\(irb([^)]+)\|\([[0-9]+] \)?[Pp]ry ?([^)]+)\|\(jruby-\|JRUBY-\)?[1-9]\.[0-9]\(\.[0-9]+\)\(-?p?[0-9]+\)?\|^rbx-head\) ?[0-9:] ?> *\)" evil-line-move: End of buffer

Just in case, rails/irb console works fine in the regular/detached "bundle exec rails c" kind of shell.

Ruby version: 3.0.2

-- 7 mins later update: It doesn't seem to be related to the Ruby version. Exactly the same result w/ 2.7.5

-- 35 mins later update: .irbrc(or .railsrc) files didn't exist when I experienced this issue.

nfedyashev avatar Dec 14 '21 11:12 nfedyashev

I've tried the following .irbrc config from this manual and inf-ruby works great again.

   IRB.conf[:USE_MULTILINE] = nil
   IRB.conf[:USE_SINGLELINE] = false
   IRB.conf[:PROMPT_MODE] = :INF_RUBY

   IRB.conf[:USE_READLINE] = false 
   IRB.conf[:USE_COLORIZE] = true

nfedyashev avatar Dec 14 '21 11:12 nfedyashev

Sounds good. Though I think you might get away with only using one or two of these statements (probably multiline; colorize and prompt mode -- might not be required).

dgutov avatar Dec 14 '21 22:12 dgutov

How do you launch the rains console, BTW?

Is it M-x inf-ruby or M-x inf-ruby-console-auto?

dgutov avatar Dec 14 '21 22:12 dgutov

From what I see, missing .irbrc breaks both(inf-ruby and inf-ruby-console-auto) for me - can type commands but can't execute them(no Enter/comint-send-input)

nfedyashev avatar Dec 15 '21 04:12 nfedyashev

Though I think you might get away with only using one or two of these statements

  1. I've tried .irbrc w/ the following line: IRB.conf[:USE_MULTILINE] = nil

it didn't work.

  1. just the following line IRB.conf[:USE_SINGLELINE] = false

worked fine

  1. or just IRB.conf[:PROMPT_MODE] = :INF_RUBY

worked too.

HTH

nfedyashev avatar Dec 15 '21 04:12 nfedyashev

IRB.conf[:USE_MULTILINE] = nil

Perhaps

IRB.conf[:USE_MULTILINE] = false

would work?

and inf-ruby-console-auto

Hm, okay. Which version of Rails are you using? Like a comment in inf-ruby-console-rails's definition says, our workaround is supposed to work in Rails > 5.1.4.

dgutov avatar Dec 15 '21 14:12 dgutov

Rails version 6.1.4.1

OK this is embarrassing, now it works even without ~/.irbrc file. I'm sorry for this unreliable bug report. If I find something relevant, I'll post it in this thread.

Or let me know if you need some kind of additional info.

nfedyashev avatar Dec 15 '21 16:12 nfedyashev

Perhaps there was some scenario where this doesn't work. I'd still like to hear about it.

Maybe you didn't have inf-ruby at the latest version. Or maybe launching through inf-ruby-console-rails is different than through inf-ruby-console-auto? Though it shouldn't be.

Thanks.

dgutov avatar Dec 15 '21 19:12 dgutov

@dgutov sorry for the delay. I'll post some more info whenever I find some free time

nfedyashev avatar Dec 17 '21 16:12 nfedyashev

Let me know if you see this again.

dgutov avatar Sep 28 '23 23:09 dgutov