Aborting `rake` execution needlessly dumps a backtrace

Open
#272 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
cli

Research direction

Start by locating rake's command-line handling for Ctrl+C or the Interrupt exception, then inspect how the --trace option affects error output. Reproduce the current behavior with a representative rake invocation; done means Ctrl+C exits with status 1 without a backtrace by default, while --trace retains the backtrace.

Written by the indexing model from the issue text.

Description

When aborting rake with Ctrl+C, it outputs rake aborted! then dumps a long backtrace. This seems unnecessary, as aborting isn't really an unexpected outcome of pressing Ctrl+C (or sending an INT signal).

I'd like to propose catching the Interrupt exception and exiting cleanly (with an exit code of 1). We can still print the backtrace if the --trace option is used.

I can submit a pull request, if this seems reasonable.

Dominant language
Ruby
Stars
2.5k
Forks
649
Avg merge
4m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby/rake

All issues in ruby/rake

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.