Is there a way to get out of a “hung” state in IRB?

后端 未结 2 1866
轻奢々
轻奢々 2020-12-19 08:15

When using irb or rails console, I sometimes get stuck. For example, I forget a closing quote, so when I press enter, it\'s still waiting on that.<

相关标签:
2条回答
  • 2020-12-19 08:48

    Press Control + D once or twice. That should do it.

    0 讨论(0)
  • 2020-12-19 08:56

    when you get recursion or Ctrl+D doesn't work

    you can kill current process ($$)

    exec("kill -9 #{$$}")
    
    0 讨论(0)
提交回复
热议问题