ruby / ruby/rake

Aborting `rake` execution needlessly dumps a backtrace

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

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.5k
Forks
650
Avg merge
6m
Merged PRs (30d)
3

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.

Contributor guide

Open the contributing guide

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.