Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
REPL transcript paste can't be saved #9214
If a SO answer is in REPL transcript form, people want to be able to copy/paste it to their REPL and save the session.
That's not currently possible, although the transcript can be edited from history (but they could have pasted directly to their editor at that point).
A session is not exactly valid code, so it would be nice if save command had an option to fix things up a bit.
scala> scala> import PartialFunction._ // Detected repl transcript paste: ctrl-D to finish. import PartialFunction._ scala> // more transcript and ctrl-D // Replaying 3 commands from transcript. scala> import PartialFunction._ import PartialFunction._ scala> // more scala> :save useful.script No replay commands in session scala> "abc" res2: String = abc scala> .length res3: Int = 3 scala> :save useful.script
The script from the last commands looks like:
Imported From: https://issues.scala-lang.org/browse/SI-9214?orig=1