ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [29/45] incubator-ignite git commit: # ignite-667 Visor console workaround for IDEA terminal.
Date Thu, 16 Apr 2015 12:33:50 GMT
# ignite-667 Visor console workaround for IDEA terminal.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cc620909
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cc620909
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cc620909

Branch: refs/heads/ignite-gg-9613
Commit: cc62090917edb1a83d4dbfc09860952bbc6e665a
Parents: 4649f85
Author: Andrey Novikov <anovikov@gridgain.com>
Authored: Tue Apr 14 16:49:46 2015 +0700
Committer: Andrey Novikov <anovikov@gridgain.com>
Committed: Tue Apr 14 16:49:46 2015 +0700

----------------------------------------------------------------------
 modules/visor-console/pom.xml                   |  4 ++--
 .../ignite/visor/commands/VisorConsole.scala    | 20 +++++++++++++++-----
 2 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc620909/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index c5b9523..7abd896 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -83,9 +83,9 @@
         </dependency>
 
         <dependency>
-            <groupId>org.scala-lang</groupId>
+            <groupId>jline</groupId>
             <artifactId>jline</artifactId>
-            <version>2.11.0-M3</version>
+            <version>2.12.1</version>
         </dependency>
         <!-- Third party dependencies -->
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc620909/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
index 1d5c4b8..bc815b3 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
@@ -22,6 +22,11 @@ import org.apache.ignite.internal.util.scala.impl
 import org.apache.ignite.internal.util.{IgniteUtils => U}
 import org.apache.ignite.startup.cmdline.AboutDialog
 
+import jline.TerminalSupport
+import jline.console.ConsoleReader
+import jline.console.completer.Completer
+import jline.internal.Configuration
+
 import javax.swing.ImageIcon
 import java._
 import java.awt.Image
@@ -50,10 +55,6 @@ import org.apache.ignite.visor.commands.vvm.VisorVvmCommand
 import org.apache.ignite.visor.visor
 import org.apache.ignite.visor.visor._
 
-import scala.tools.jline.console.ConsoleReader
-import scala.tools.jline.console.completer.Completer
-import scala.tools.jline.internal.Configuration
-
 /**
  * Command line Visor.
  */
@@ -142,7 +143,16 @@ object VisorConsole extends App {
         case None => new FileInputStream(FileDescriptor.in)
     }
 
-    private val reader = new ConsoleReader(inputStream, System.out, null, null)
+    // Workaround for IDEA terminal.
+    val term = try {
+        Class.forName("com.intellij.rt.execution.application.AppMain")
+
+        new TerminalSupport(true) {}
+    } catch {
+        case ignored: ClassNotFoundException => null
+    }
+
+    private val reader = new ConsoleReader(inputStream, System.out, term)
 
     reader.addCompleter(new VisorCommandCompleter(visor.commands))
     reader.addCompleter(new VisorFileNameCompleter())


Mime
View raw message