qmk / qmk/qmk_cli

[Feature Request] Catch `KeyboardInterrupt`s (CTRL-C) in the CLI

Open
#160 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Python
Stars
187
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Feature Request Type
  • Core functionality
  • Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior
Description

Currently when you press CTRL-C while the CLI is running, you'll see the default Python behavior of showing the (sometimes very long) traceback. This is rarely going to be useful and just clutters the terminal output.

I suggest that we catch KeyboardInterrupts (can be done globally with a signal handler as well) and just exit w/o printing anything. or perhaps just a short message like Pressed CTRL-C or something like that. Thoughts?

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 the CLI entry point and the code path that currently allows KeyboardInterrupt to print Python's default traceback. Decide whether completion should be silent or use a short message, then verify that pressing CTRL-C exits without the long traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.