X.<tab> kills pry. #605

Closed
ConradIrwin opened this Issue Jun 22, 2012 · 1 comment

2 participants

@ConradIrwin
pry member

100929:/0/transmogrifier[master].$ pry -rampex
[1] pry(main)> X.Error: can't convert Metavariable to Array (Metavariable#to_ary gives Metavariable)
FATAL: Pry failed to get user input using Readline.
To fix this you may be able to pass input and output file descriptors to pry directly. e.g.
Pry.config.input = STDIN
Pry.config.output = STDOUT
binding.pry

@felixrabe

Happens for me too with JRuby: (trying to autocomplete 'java.lang.Sy...stem' there)

fr@w500 PVAJ (Java) $ rvm use jruby
Using /home/fr/.rvm/gems/jruby-1.6.7.2
fr@w500 PVAJ (Java) $ pry -v
Pry version 0.9.9.6 on Ruby 1.9.2
fr@w500 PVAJ (Java) $ pry
[1] pry(main)> require 'java'
=> false
[2] pry(main)> java.lang.SyError: Java package `org.jruby.runtime' does not have a method `instance_methods'
FATAL: Pry failed to get user input using `Readline`.
To fix this you may be able to pass input and output file descriptors to pry directly. e.g.
  Pry.config.input = STDIN
  Pry.config.output = STDOUT
  binding.pry
@ConradIrwin ConradIrwin added a commit that referenced this issue Jul 6, 2012
@ConradIrwin ConradIrwin Be more careful exception handling in Readline [Fixes #632, #605]
Firstly wrap the entire completion_proc in a begin/rescue/end so that
even if something we're not expecting goes wrong, we don't fail.

Secondly, only throw the user out of pry if reading from readline fails
five times in a row. This avoids a transient error (like a time-out, or
a failed tab completion) from kicking you out of pry; but also avoids
the infinite looping problem that can happen if the error is not transient.
b5cb8b1
@ConradIrwin ConradIrwin closed this Jul 6, 2012
@ghost Unknown pushed a commit that referenced this issue Apr 6, 2014
@ConradIrwin ConradIrwin Be more careful exception handling in Readline [Fixes #632, #605]
Firstly wrap the entire completion_proc in a begin/rescue/end so that
even if something we're not expecting goes wrong, we don't fail.

Secondly, only throw the user out of pry if reading from readline fails
five times in a row. This avoids a transient error (like a time-out, or
a failed tab completion) from kicking you out of pry; but also avoids
the infinite looping problem that can happen if the error is not transient.
62fd85e
@jazzonmymind jazzonmymind pushed a commit that referenced this issue Nov 23, 2014
@ConradIrwin ConradIrwin Be more careful exception handling in Readline [Fixes #632, #605]
Firstly wrap the entire completion_proc in a begin/rescue/end so that
even if something we're not expecting goes wrong, we don't fail.

Secondly, only throw the user out of pry if reading from readline fails
five times in a row. This avoids a transient error (like a time-out, or
a failed tab completion) from kicking you out of pry; but also avoids
the infinite looping problem that can happen if the error is not transient.
65e751c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment