Table of Contents
-
Multi OS (Mac, Win, *Nix) Support
-
Terminal Emulator (Xterm)
-
Copy and Paste Support
-
CygWin Support
-
Configurable (Color, Size, Font)
-
Multi Tab Support
Default Config
TerminalBuilder terminalBuilder = new TerminalBuilder();
TerminalTab terminal = terminalBuilder.newTerminal();
TabPane tabPane = new TabPane();
tabPane.getTabs().add(terminal);
Dark Config
TerminalConfig darkConfig = new TerminalConfig();
darkConfig.setBackgroundColor(Color.rgb(16, 16, 16));
darkConfig.setForegroundColor(Color.rgb(240, 240, 240));
darkConfig.setCursorColor(Color.rgb(255, 0, 0, 0.5));
TerminalBuilder terminalBuilder = new TerminalBuilder(darkConfig);
TerminalTab terminal = terminalBuilder.newTerminal();
TabPane tabPane = new TabPane();
tabPane.getTabs().add(terminal);
TerminalConfig cygwinConfig = new TerminalConfig();
cygwinConfig.setWindowsTerminalStarter("C:\\cygwin64\\bin\\bash -i"); (1)
TerminalBuilder terminalBuilder = new TerminalBuilder(cygwinConfig);
TerminalTab terminal = terminalBuilder.newTerminal();
TabPane tabPane = new TabPane();
tabPane.getTabs().add(terminal);
-
Set bash in cygwin path
<!-- Add repository -->
<repositories>
<repository>
<id>terminalfx-repo</id>
<url>https://github.com/javaterminal/terminalfx/raw/master/releases</url>
</repository>
</repositories>
<!-- Add dependency for Java 12-->
<dependency>
<groupId>com.kodedu.terminalfx</groupId>
<artifactId>terminalfx</artifactId>
<version>1.1.0</version>
</dependency>
<!-- Add dependency for Java 8-->
<dependency>
<groupId>com.kodedu.terminalfx</groupId>
<artifactId>terminalfx</artifactId>
<version>1.0.8</version>
</dependency>
git clone https://github.com/rahmanusta/TerminalFX
cd TerminalFX
mvn clean install
mvn javafx:run
The following modules have to be added in JVM parameters
--add-modules=javafx.controls,javafx.graphics
You can run commands:
terminal.onTerminalFxReady(() -> {
terminal.getTerminal().command("java -version\r");
});
This project is licensed under the MIT license. See LICENSE for more information.