Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Changing Pry.config.input makes the prompt disappear #821

Open
AArmada opened this Issue · 3 comments

3 participants

@AArmada

I am trying to use Pry with Netbeans. When i use binding.pry within my code everything displays correctly, but the input from STDIN is not directed into pry, so I can't do anything.
Output, here i attempted to use the ls command:

     6: puts "Setting prys input"
     7: var = "I am a variable"
     8: var2 = 123
     9: #Pry.config.input = STDIN
    10: puts "time-freeze!"
 => 11: binding.pry
    12: puts "Resume"
    13: puts var

[1] pry(main)> ls

Nothing happens.

If i un-comment line 9 Pry.config.input = STDIN and run it again i get the following output:

     6: puts "Setting prys input"
     7: var = "I am a variable"
     8: var2 = 123
     9: Pry.config.input = STDIN
    10: puts "time-freeze!"
 => 11: binding.pry
    12: puts "Resume"
    13: puts var

ls
self.methods: include  private  public  to_s
locals: _  __  _dir_  _ex_  _file_  _in_  _out_  _pry_  var  var2

Here the commands are sent to pry and the response is displayed, but there is no prompt.

I can also replicate this when running from the command line.

@banister
Owner

We currently dont implement a prompt for STDIN input, i guess we could..

@AArmada

So it is expected behavior? Is there a way that i could re-implement it?

@banister
Owner

Well, the reason we have a prompt with Readline is because readline does all the work for us (it has a 'prompt' parameter). If you were to provide a prompt for stdin as well, u'd need to explicitly print out the prompt before you request the input, it's not hard, but doing it in an intelligent way might require some thought. i.e i'd like to avoid any explicit checks for stdin in the input methods (though maybe this is hard to avoid, but it'd be very ugly).

@rf- rf- added the feature label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.