Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B89C7200BF3 for ; Thu, 22 Dec 2016 03:08:54 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B7482160B39; Thu, 22 Dec 2016 02:08:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0C5ED160B26 for ; Thu, 22 Dec 2016 03:08:53 +0100 (CET) Received: (qmail 88871 invoked by uid 500); 22 Dec 2016 02:08:53 -0000 Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@trafodion.apache.org Delivered-To: mailing list commits@trafodion.apache.org Received: (qmail 88862 invoked by uid 99); 22 Dec 2016 02:08:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2016 02:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9A55618C6BB for ; Thu, 22 Dec 2016 02:08:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id DodyaUWOoY_V for ; Thu, 22 Dec 2016 02:08:51 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id DCAD75F2F1 for ; Thu, 22 Dec 2016 02:08:50 +0000 (UTC) Received: (qmail 88621 invoked by uid 99); 22 Dec 2016 02:08:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2016 02:08:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 10C7CF1761; Thu, 22 Dec 2016 02:08:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: liuming@apache.org To: commits@trafodion.incubator.apache.org Date: Thu, 22 Dec 2016 02:08:38 -0000 Message-Id: <5ad4ce8293ff4194bdf2b3f10c568e1f@git.apache.org> In-Reply-To: <15b0f72a383f4122a5ef840648720686@git.apache.org> References: <15b0f72a383f4122a5ef840648720686@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/6] incubator-trafodion git commit: allow ctrl-c behavior archived-at: Thu, 22 Dec 2016 02:08:54 -0000 allow ctrl-c behavior Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/eb2dcd91 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/eb2dcd91 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/eb2dcd91 Branch: refs/heads/master Commit: eb2dcd911d8cdf24851eaec6a5b67852fb425db9 Parents: a88b4dc Author: mashengchen Authored: Mon Dec 19 03:56:03 2016 +0000 Committer: mashengchen Committed: Mon Dec 19 03:56:03 2016 +0000 ---------------------------------------------------------------------- .../src/main/java/org/trafodion/ci/ConsoleReader.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/eb2dcd91/core/conn/trafci/src/main/java/org/trafodion/ci/ConsoleReader.java ---------------------------------------------------------------------- diff --git a/core/conn/trafci/src/main/java/org/trafodion/ci/ConsoleReader.java b/core/conn/trafci/src/main/java/org/trafodion/ci/ConsoleReader.java index 81f6b4e..26009a1 100644 --- a/core/conn/trafci/src/main/java/org/trafodion/ci/ConsoleReader.java +++ b/core/conn/trafci/src/main/java/org/trafodion/ci/ConsoleReader.java @@ -28,6 +28,7 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; +import jline.console.UserInterruptException; import sun.misc.Signal; import sun.misc.SignalHandler; @@ -111,6 +112,7 @@ public class ConsoleReader this.in=System.in; cr = new jline.console.ConsoleReader(); cr.setPrompt(this.prompt); + cr.setHandleUserInterrupt(true); } public String getLine() throws IOException, UserInterruption @@ -177,7 +179,13 @@ public class ConsoleReader } } */ - return cr.readLine(); + String readLine = null; + try { + readLine = cr.readLine(); + } catch (UserInterruptException e) { + // TODO Auto-generated catch block + } + return readLine; } public boolean next() throws IOException, UserInterruption