mycli icon indicating copy to clipboard operation
mycli copied to clipboard

More information and care on `KeyboardInterrupt`

Open rolandwalker opened this issue 6 months ago • 0 comments

Description

mycli is already much better at cancelling queries on KeyboardInterrupt, compared to the vendor client. But not perfect -- and sometimes the result is an unfortunate runaway query.

Here we:

  • catch the case that "ok" is not in the status string, and emit a warning in red. Previously we only caught Exceptions.
  • add an echo to the debugged path in which cancellation is skipped.
  • downgrade the routine cancellation message to blue and add the query id number.

The first and second changes are intended to help the user notice the cases in which we fail to interrupt, and know that we failed. The third change is intended to help in unknown cases, in which we believe that we succeeded, but didn't actually interrupt.

example_query_cancel

Checklist

  • [x] I've added this contribution to the changelog.md.
  • [x] I've added my name to the AUTHORS file (or it's already there).

rolandwalker avatar Jun 07 '25 12:06 rolandwalker