From 92d1620a05d1f4f37811c283e669e08cc009a4f2 Mon Sep 17 00:00:00 2001 From: srliao <906239+srliao@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:08:24 -0500 Subject: [PATCH] add console.ErrCtrlC --- interrupt.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interrupt.go b/interrupt.go index b37105c..a974a78 100644 --- a/interrupt.go +++ b/interrupt.go @@ -1,5 +1,12 @@ package console +import ( + "errors" + "os" +) + +var ErrCtrlC = errors.New(os.Interrupt.String()) + // AddInterrupt registers a handler to run when the console receives a given // interrupt error from the underlying readline shell. Mainly two interrupt // signals are concerned: io.EOF (returned when pressing CtrlD), and console.ErrCtrlC.