mirror of
https://github.com/corda/corda.git
synced 2025-02-09 20:31:18 +00:00
DemoBench: enable emoji in the terminal when built with a JetBrains JRE.
This commit is contained in:
parent
af1a68da67
commit
f4321affad
@ -7,8 +7,12 @@ import net.corda.core.codePointsString
|
|||||||
*/
|
*/
|
||||||
object Emoji {
|
object Emoji {
|
||||||
// Unfortunately only Apple has a terminal that can do colour emoji AND an emoji font installed by default.
|
// Unfortunately only Apple has a terminal that can do colour emoji AND an emoji font installed by default.
|
||||||
|
// However the JediTerm java terminal emulator can also do emoji on OS X when using the JetBrains JRE.
|
||||||
|
// Check for that here. DemoBench sets TERM_PROGRAM appropriately.
|
||||||
val hasEmojiTerminal by lazy {
|
val hasEmojiTerminal by lazy {
|
||||||
System.getenv("CORDA_FORCE_EMOJI") != null || System.getenv("TERM_PROGRAM") in listOf("Apple_Terminal", "iTerm.app")
|
System.getenv("CORDA_FORCE_EMOJI") != null ||
|
||||||
|
System.getenv("TERM_PROGRAM") in listOf("Apple_Terminal", "iTerm.app") ||
|
||||||
|
(System.getenv("TERM_PROGRAM") == "JediTerm" && System.getProperty("java.vendor") == "JetBrains s.r.o")
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic val CODE_SANTA_CLAUS: String = codePointsString(0x1F385)
|
@JvmStatic val CODE_SANTA_CLAUS: String = codePointsString(0x1F385)
|
||||||
|
@ -89,7 +89,6 @@ Developers wishing to run DemoBench *without* building a new installer each time
|
|||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
|
|
||||||
Unfortunately, DemoBench's ``$CLASSPATH`` may be too long for the Windows shell . In which case you can still run DemoBench as follows:
|
Unfortunately, DemoBench's ``$CLASSPATH`` may be too long for the Windows shell . In which case you can still run DemoBench as follows:
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
@ -98,7 +97,9 @@ Unfortunately, DemoBench's ``$CLASSPATH`` may be too long for the Windows shell
|
|||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
While DemoBench *can* be executed within an IDE, it would be up to the Developer to install all of its runtime dependencies beforehand into their correct locations relative to the value of the ``user.dir`` system property (i.e. the current working directory of the JVM):
|
While DemoBench *can* be executed within an IDE, it would be up to the Developer to install all of its runtime
|
||||||
|
dependencies beforehand into their correct locations relative to the value of the ``user.dir`` system property (i.e. the
|
||||||
|
current working directory of the JVM):
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
@ -112,3 +113,9 @@ While DemoBench *can* be executed within an IDE, it would be up to the Developer
|
|||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
|
Mac users should note that the best way to build a DemoBench DMG is with the `JetBrains JDK <https://github.com/JetBrains/jdk8u>`_
|
||||||
|
which has `binary downloads available from BinTray <https://bintray.com/jetbrains/intellij-jdk>`_.
|
||||||
|
This JDK has some useful GUI fixes, most notably, when built with this JDK the DemoBench terminal will support emoji
|
||||||
|
and as such, the nicer coloured ANSI progress renderer. It also resolves some issues with hidpi rendering on
|
||||||
|
Windows.
|
||||||
|
|
||||||
|
@ -18,9 +18,6 @@ import static net.corda.node.shell.InteractiveShell.*;
|
|||||||
)
|
)
|
||||||
@Usage("Start a (work)flow on the node. This is how you can change the ledger.")
|
@Usage("Start a (work)flow on the node. This is how you can change the ledger.")
|
||||||
public class FlowShellCommand extends InteractiveShellCommand {
|
public class FlowShellCommand extends InteractiveShellCommand {
|
||||||
// Note that the class name is deliberately lower case, because we want the command the user types to be
|
|
||||||
// lower case. CRaSH should ideally lowercase the command names for us, but it doesn't.
|
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
public void start(
|
public void start(
|
||||||
@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
||||||
|
@ -62,12 +62,8 @@ dependencies {
|
|||||||
// FontAwesomeFX: icons in the form of a font.
|
// FontAwesomeFX: icons in the form of a font.
|
||||||
compile "de.jensd:fontawesomefx-fontawesome:4.7.0-5"
|
compile "de.jensd:fontawesomefx-fontawesome:4.7.0-5"
|
||||||
|
|
||||||
// These libraries don't exist in any Maven repository I can find.
|
// JediTerm: the terminal emulator used in IntelliJ. We have forked it and tweaked it, see https://github.com/corda/jediterm
|
||||||
// See: https://github.com/JetBrains/jediterm
|
compile ':terminal-331a005d6793e52cefc9e2cec6774e62d5a546b1'
|
||||||
//
|
|
||||||
// The terminal JAR here has also been tweaked:
|
|
||||||
// See: https://github.com/JetBrains/jediterm/issues/144
|
|
||||||
compile ':jediterm-terminal-2.5'
|
|
||||||
compile ':pty4j-0.7.2'
|
compile ':pty4j-0.7.2'
|
||||||
|
|
||||||
testCompile project(':node')
|
testCompile project(':node')
|
||||||
|
Binary file not shown.
@ -49,9 +49,8 @@ class R3Pty(val name: X500Name, settings: SettingsProvider, dimension: Dimension
|
|||||||
val environment = envs.toMutableMap()
|
val environment = envs.toMutableMap()
|
||||||
if (!UIUtil.isWindows) {
|
if (!UIUtil.isWindows) {
|
||||||
environment["TERM"] = "xterm"
|
environment["TERM"] = "xterm"
|
||||||
|
// This, in combination with running on a Mac JetBrains JRE, enables emoji in Mac demobench.
|
||||||
// This environment variable is specific to MacOSX.
|
environment["TERM_PROGRAM"] = "JediTerm"
|
||||||
environment.remove("TERM_PROGRAM")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val connector = createTtyConnector(args, environment, workingDir)
|
val connector = createTtyConnector(args, environment, workingDir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user