Skip to content

Instantly share code, notes, and snippets.

@cpetschnig
Created May 5, 2011 11:31
Show Gist options
  • Save cpetschnig/956898 to your computer and use it in GitHub Desktop.
Save cpetschnig/956898 to your computer and use it in GitHub Desktop.
Avoid stack trace when canceling the Capistrano menu
# Put this code in your deploy.rb, if you are annoyed by
# the stack trace when aborting the capistrano with ^C
# (under MIT License)
require 'active_support/core_ext/module'
# avoid having a whole page of stack trace when you abort the menu with `^C`
HighLine.module_eval do
def get_line_with_interrupt_catching
get_line_without_interrupt_catching
rescue Interrupt
puts
exit
end
alias_method_chain :get_line, :interrupt_catching
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment