qmk_cli icon indicating copy to clipboard operation
qmk_cli copied to clipboard

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

Open tomasr8 opened this issue 2 years ago • 1 comments

Feature Request Type

  • [ ] Core functionality
  • [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • [X] 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?

tomasr8 avatar Sep 29 '23 21:09 tomasr8

This is probably an issue for https://github.com/clueboard/milc.

fauxpark avatar Oct 03 '23 13:10 fauxpark