trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [4/6] incubator-trafodion git commit: allow ctrl-c behavior
Date Thu, 22 Dec 2016 02:08:38 GMT
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 <mashengchen@gmail.com>
Authored: Mon Dec 19 03:56:03 2016 +0000
Committer: mashengchen <mashengchen@gmail.com>
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


Mime
View raw message