Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the :sh command in the REPL #21657

Open
Gedochao opened this issue Sep 27, 2024 · 0 comments
Open

Add support for the :sh command in the REPL #21657

Gedochao opened this issue Sep 27, 2024 · 0 comments
Labels
area:repl compat:scala2:feature-parity Issues tied with features which were at some point included in Scala 2 and could be brought over. itype:enhancement

Comments

@Gedochao
Copy link
Contributor

The :sh command was (and is) supported by the Scala 2 REPL, while it is visibly absent in Scala 3.

scala -S 2.13
Welcome to Scala 2.13.15 (OpenJDK 64-Bit Server VM, Java 17).
Type in expressions for evaluation. Or try :help.
scala> :help
All commands can be abbreviated, e.g., :he instead of :help.
(...)
:sh <command line>       run a shell command (result is implicitly => List[String])
(...)
scala> :sh scala-cli --help
val res9: scala.tools.nsc.interpreter.shell.ProcessResult = `scala-cli --help` (54 lines, exit 0)

scala> res9.lines.mkString(System.lineSeparator)
val res10: String =
Usage: scala-cli <COMMAND>
Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run and test your Scala code.

Main commands:
  clean                  Clean the workspace.
  compile                Compile Scala code.
  doc                    Generate Scaladoc documentation.
  fmt, format, scalafmt  Formats Scala code.
  repl, console          Fire-up a Scala REPL.
  run                    Compile and run Scala code.
  test                   Compile and test Scala code.

Miscellaneous commands:
  version  Prints the version of the Scala CLI and the default version of Scala.

Other commands:
  config    ...
@Gedochao Gedochao added itype:enhancement area:repl compat:scala2:feature-parity Issues tied with features which were at some point included in Scala 2 and could be brought over. labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:repl compat:scala2:feature-parity Issues tied with features which were at some point included in Scala 2 and could be brought over. itype:enhancement
Projects
None yet
Development

No branches or pull requests

1 participant