Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 2ceb09c

Browse files
Igor Racicsom-snytt
authored andcommitted
SI-9206: REPL custom history file
Specify it with -Dscala.shell.histfile=/path/to/file.
1 parent 934a314 commit 2ceb09c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ package scala.tools.nsc.interpreter.jline
77

88
import _root_.jline.console.history.PersistentHistory
99

10-
1110
import scala.tools.nsc.interpreter
12-
import scala.tools.nsc.io.{File, Path}
11+
import scala.reflect.io.{ File, Path }
12+
import scala.tools.nsc.Properties.{ propOrNone, userHome }
1313

1414
/** TODO: file locking.
1515
*/
@@ -85,9 +85,9 @@ object FileBackedHistory {
8585
// val ContinuationChar = '\003'
8686
// val ContinuationNL: String = Array('\003', '\n').mkString
8787

88-
import scala.tools.nsc.Properties.userHome
89-
90-
def defaultFileName = ".scala_history"
88+
final val defaultFileName = ".scala_history"
9189

92-
def defaultFile: File = File(Path(userHome) / defaultFileName)
90+
def defaultFile: File = File(
91+
propOrNone("scala.shell.histfile") map (Path.apply) getOrElse (Path(userHome) / defaultFileName)
92+
)
9393
}

0 commit comments

Comments
 (0)