Java FX Terminal Emulator
Switch branches/tags
Nothing to show
Clone or download
Latest commit b2254e0 Aug 18, 2018

README.adoc

JavaFX Terminal Emulator

1. JavaFX Terminal Emulator

TerminalFX is a terminal (PTY) emulator application written in JavaFX 8.

We use Pty4J to get VT codes from running process and hterm.js from Chromium project to interact with Pty4J. TerminalFX is using powerful JavaFX WebView component to run hterm.js.

2. Features

  • Multi OS (Mac, Win, *Nix) Support

  • Terminal Emulator (Xterm)

  • Copy and Paste Support

  • CygWin Support

  • Configurable (Color, Size, Font)

  • Multi Tab Support

3. Usage

Default Config
TerminalBuilder terminalBuilder = new TerminalBuilder();
TerminalTab terminal = terminalBuilder.newTerminal();

TabPane tabPane = new TabPane();
tabPane.getTabs().add(terminal);
images\default
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);
images\dark

4. CygWin Support

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);
  1. Set bash in cygwin path

images\cygwin

5. Maven Dependency

<!-- Add repository -->
<repositories>
    <repository>
    <id>terminalfx-repo</id>
    <url>https://github.com/javaterminal/terminalfx/raw/master/releases</url>
    </repository>
</repositories>

<!-- Add dependency -->
<dependency>
    <groupId>com.kodedu.asciidocfx</groupId>
    <artifactId>terminalfx</artifactId>
    <version>1.0.6</version>
</dependency>

6. Compile & Run

git clone https://github.com/rahmanusta/TerminalFX
cd TerminalFX
mvn clean install
mvn exec:java -Dexec.mainClass="com.kodedu.terminalfx.TerminalAppStarter"

7. Run command

You can run commands:

terminal.onTerminalFxReady(() -> {
    terminal.command("java -version\r");
});

8. Licence

MIT