Don't swallow control-C (#588)
* Don't swallow control-C * Raise NimbleError instead of quitting * Import NimbleError from common rather than version
This commit is contained in:
parent
d9055dbac6
commit
ba6577d36c
1 changed files with 4 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
||||||
# - Normal for MediumPriority.
|
# - Normal for MediumPriority.
|
||||||
|
|
||||||
import logging, terminal, sets, strutils, os
|
import logging, terminal, sets, strutils, os
|
||||||
|
import ./common
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
import winlean
|
import winlean
|
||||||
|
|
@ -218,6 +219,9 @@ proc promptListInteractive(question: string, args: openarray[string]): string =
|
||||||
of '\r':
|
of '\r':
|
||||||
selected = true
|
selected = true
|
||||||
break
|
break
|
||||||
|
of '\3':
|
||||||
|
showCursor(stdout)
|
||||||
|
raise newException(NimbleError, "Keyboard interrupt")
|
||||||
else: discard
|
else: discard
|
||||||
|
|
||||||
# Erase all lines of the selection
|
# Erase all lines of the selection
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue