Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ctrl-D to terminate session #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nbudin
Copy link

@nbudin nbudin commented Sep 20, 2013

pry-remote-em currently blows up if you press Ctrl-D, with:

/Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/pry-remote-em-0.7.5/lib/pry-remote-em/client.rb:250:in `block in readline': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:951:in `call'
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:951:in `run_deferred_callbacks'
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/pry-remote-em-0.7.5/bin/pry-remote-em:64:in `<top (required)>'
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/bin/pry-remote-em:23:in `load'
    from /Users/nbudin/.rbenv/versions/2.0.0-p195/bin/pry-remote-em:23:in `<main>'

This patch simply checks if the line passed to the callback is nil, and if so, assumes the user pressed Ctrl-D to end the session.

@kovyrin
Copy link

kovyrin commented Oct 12, 2013

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants