diff --git a/build.sbt b/build.sbt
index 8d89a1f6f0e1..55a906ad2e8b 100644
--- a/build.sbt
+++ b/build.sbt
@@ -45,9 +45,9 @@ val junitInterfaceDep = "com.novocode" % "junit-interface"
val scalacheckDep = "org.scalacheck" %% "scalacheck" % "1.14.3" % "test"
val jolDep = "org.openjdk.jol" % "jol-core" % "0.9"
val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version")
-val jlineDep = "org.jline" % "jline" % versionProps("jline.version")
-val jansiDep = "org.fusesource.jansi" % "jansi" % versionProps("jansi.version")
-val jlineDeps = Seq(jlineDep, jansiDep)
+val jlineDep = "org.jline" % "jline" % versionProps("jline.version") % Optional
+val jnaDep = "net.java.dev.jna" % "jna" % versionProps("jna.version") % Optional
+val jlineDeps = Seq(jlineDep, jnaDep)
val testInterfaceDep = "org.scala-sbt" % "test-interface" % "1.0"
val diffUtilsDep = "com.googlecode.java-diff-utils" % "diffutils" % "1.3.0"
@@ -682,7 +682,7 @@ lazy val compiler = configureAsSubproject(project)
|org.jline.style.*;resolution:=optional
|org.jline.terminal;resolution:=optional
|org.jline.terminal.impl;resolution:=optional
- |org.jline.terminal.impl.jansi.*;resolution:=optional
+ |org.jline.terminal.impl.jna.*;resolution:=optional
|org.jline.terminal.spi;resolution:=optional
|org.jline.utils;resolution:=optional
|scala.*;version="$${range;[==,=+);$${ver}}"
@@ -1226,10 +1226,10 @@ lazy val dist = (project in file("dist"))
packageBin in Compile := {
val targetDir = (buildDirectory in ThisBuild).value / "pack" / "lib"
val jlineJAR = findJar((dependencyClasspath in Compile).value, jlineDep).get.data
- val jansiJAR = findJar((dependencyClasspath in Compile).value, jansiDep).get.data
+ val jnaJAR = findJar((dependencyClasspath in Compile).value, jnaDep).get.data
val mappings = Seq(
(jlineJAR, targetDir / "jline.jar"),
- (jansiJAR, targetDir / "jansi.jar"),
+ (jnaJAR, targetDir / "jna.jar"),
)
IO.copy(mappings, CopyOptions() withOverwrite true)
targetDir
diff --git a/doc/LICENSE.md b/doc/LICENSE.md
index b9a40b63c4b9..83ef781d15f1 100644
--- a/doc/LICENSE.md
+++ b/doc/LICENSE.md
@@ -28,7 +28,7 @@ which are also included in the `licenses/` directory:
### [Apache License](http://www.apache.org/licenses/LICENSE-2.0.html)
This license is used by the following third-party libraries:
- * Jansi
+ * JNA
### [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
This license is used by the following third-party libraries:
diff --git a/doc/License.rtf b/doc/License.rtf
index ba8cebaea6aa..376ec02cb530 100644
--- a/doc/License.rtf
+++ b/doc/License.rtf
@@ -48,7 +48,7 @@ Unless required by applicable law or agreed to in writing, software distributed
\f0\b0 \cf2 This license is used by the following third-party libraries:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl360\partightenfactor0
\ls1\ilvl0\cf2 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
-Jansi\
+JNA\
\pard\pardeftab720\sl300\partightenfactor0
\f1\b \cf3 \
diff --git a/doc/licenses/apache_jansi.txt b/doc/licenses/apache_jna.txt
similarity index 98%
rename from doc/licenses/apache_jansi.txt
rename to doc/licenses/apache_jna.txt
index 067a5a6a3432..592efd6604bd 100644
--- a/doc/licenses/apache_jansi.txt
+++ b/doc/licenses/apache_jna.txt
@@ -1,4 +1,6 @@
-Scala includes the JLine library, which includes the Jansi library.
+Scala includes the JLine library, which includes the JNA library,
+which is made available under multiple licenses, including the
+Apache 2 license:
Apache License
Version 2.0, January 2004
diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE
index 8db6f173f723..ff87699c54fb 100644
--- a/src/intellij/scala.ipr.SAMPLE
+++ b/src/intellij/scala.ipr.SAMPLE
@@ -228,7 +228,7 @@
-
+
@@ -244,7 +244,7 @@
-
+
@@ -253,7 +253,7 @@
-
+
@@ -262,7 +262,7 @@
-
+
@@ -283,7 +283,7 @@
-
+
@@ -304,7 +304,7 @@
-
+
@@ -313,7 +313,7 @@
-
+
@@ -453,7 +453,7 @@
-
+
@@ -466,7 +466,7 @@
-
+
@@ -476,7 +476,7 @@
-
+
@@ -487,7 +487,7 @@
-
+
@@ -499,7 +499,7 @@
-
+
@@ -512,7 +512,7 @@
-
+
diff --git a/src/repl-frontend/scala/tools/nsc/interpreter/jline/Reader.scala b/src/repl-frontend/scala/tools/nsc/interpreter/jline/Reader.scala
index e70ea7db9db4..18c95181d2a9 100644
--- a/src/repl-frontend/scala/tools/nsc/interpreter/jline/Reader.scala
+++ b/src/repl-frontend/scala/tools/nsc/interpreter/jline/Reader.scala
@@ -54,8 +54,7 @@ object Reader {
System.setProperty(LineReader.PROP_SUPPORT_PARSEDLINE, java.lang.Boolean.TRUE.toString())
- //val terminal = TerminalBuilder.builder().build()
- val terminal = TerminalBuilder.terminal() // defaults for now
+ val terminal = TerminalBuilder.builder().jna(true).build()
val completer = new Completion(completion)
val parser = new ReplParser(repl)
val history = new DefaultHistory
diff --git a/versions.properties b/versions.properties
index e0d76b540cb6..d5df5a103282 100644
--- a/versions.properties
+++ b/versions.properties
@@ -7,5 +7,7 @@ starr.version=2.13.1
# Other usages:
# - scala-asm: jar content included in scala-compiler
scala-asm.version=7.3.1-scala-1
+
+# jna.version must be updated together with jline-terminal-jna
jline.version=3.14.0
-jansi.version=1.18
+jna.version=5.3.1