Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for embedded applications
There are unusual situations in which a container application may be using JLine3 and be invoking an application that also uses JLine3 in the same process. When this is the case, there can be conflicts between the container's JLine usage and the application. To be more specific, this is a problem for sbt and the scala REPL. This is a difficult problem to solve because sbt attempts to support all versions of scala but there is no entry point to the scala REPL that allows the calling application to pass in a custom terminal. As a result, it isn't possible for sbt using JLine3 to viably support all versions of the scala REPL. We can work workaround this by override TerminalBuilder.build to always return a statically provided Terminal that can be set via a new api: TerminalBuilder.setGlobalTerminal. This api is to be avoided in normal JLine usage so it is marked as deprecated and the javadocs hopefully do a good enough job of explaining the intended use case to discourage users from calling it unless they have an sbt like use case.
- Loading branch information