From ba6577d36cae8e1968e7f3f36fa8cbdf5387c26c Mon Sep 17 00:00:00 2001 From: Matt Haggard Date: Thu, 29 Nov 2018 18:08:02 -0700 Subject: [PATCH] Don't swallow control-C (#588) * Don't swallow control-C * Raise NimbleError instead of quitting * Import NimbleError from common rather than version --- src/nimblepkg/cli.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nimblepkg/cli.nim b/src/nimblepkg/cli.nim index 862ffe5..d8d52d5 100644 --- a/src/nimblepkg/cli.nim +++ b/src/nimblepkg/cli.nim @@ -13,6 +13,7 @@ # - Normal for MediumPriority. import logging, terminal, sets, strutils, os +import ./common when defined(windows): import winlean @@ -218,6 +219,9 @@ proc promptListInteractive(question: string, args: openarray[string]): string = of '\r': selected = true break + of '\3': + showCursor(stdout) + raise newException(NimbleError, "Keyboard interrupt") else: discard # Erase all lines of the selection