Skip to content

Support Ctrl-D to terminate session#44

Open
nbudin wants to merge 1 commit intogruis:masterfrom
nbudin:master
Open

Support Ctrl-D to terminate session#44
nbudin wants to merge 1 commit intogruis:masterfrom
nbudin:master

Conversation

@nbudin
Copy link
Copy Markdown

@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
Copy Markdown

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