Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在以前的会话中打印在 ammonite repl 中执行的代码历史记录的最佳方法是什么?我知道,repl.history但它包含来自当前会话的代码,并且我知道 ammonite 保留以前会话的历史记录,因为它们的片段可以使用“向上箭头”键获得。
repl.history
在 Linux 或 Mac 上,历史记录存储在您的主目录中的 file 中~/.ammonite/history,因此您可以只从文件中加载它:
~/.ammonite/history
import scala.util.Using import scala.io.Source val history = Using(Source.fromFile("/path/to/home/.ammonite/history"))(_.getLines)