Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javaterminal/terminalfx
Java FX Terminal Emulator
https://github.com/javaterminal/terminalfx
java javafx shell terminal terminal-emulators
Last synced: 1 day ago
JSON representation
Java FX Terminal Emulator
- Host: GitHub
- URL: https://github.com/javaterminal/terminalfx
- Owner: javaterminal
- License: mit
- Created: 2015-05-18T19:26:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T05:51:40.000Z (5 months ago)
- Last Synced: 2024-10-30T00:33:11.609Z (15 days ago)
- Topics: java, javafx, shell, terminal, terminal-emulators
- Language: Java
- Homepage:
- Size: 14 MB
- Stars: 276
- Watchers: 18
- Forks: 52
- Open Issues: 17
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= JavaFX Terminal Emulator
Rahman Usta
:doctype: article
:encoding: utf-8
:lang: en
:toc: left
:numbered:
:terminalfx-version: 1.2.0== JavaFX Terminal Emulator
TerminalFX is a terminal (PTY) emulator application written in JavaFX 18.
We use https://github.com/traff/pty4j[Pty4J] to get VT codes from running process and https://chromium.googlesource.com/apps/libapps/+/master/hterm/[hterm.js] from Chromium project to interact with Pty4J. TerminalFX is using powerful JavaFX WebView component to run hterm.js.
== Features
* Multi OS (Mac, Win, *Nix) Support
* Terminal Emulator (Xterm)
* Copy and Paste Support
* CygWin Support
* Configurable (Color, Size, Font)
* Multi Tab Support== Usage
.Default Config
[source,java]
----
TerminalBuilder terminalBuilder = new TerminalBuilder();
TerminalTab terminal = terminalBuilder.newTerminal();TabPane tabPane = new TabPane();
tabPane.getTabs().add(terminal);
----image::images\default.png[]
.Dark Config
[source,java]
----
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);
----image::images\dark.png[]
== CygWin Support
[source,java]
----
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 pathimage::images\cygwin.png[]
== Maven Dependency
[source,xml]
----
terminalfx-repo
https://github.com/javaterminal/terminalfx/raw/master/releases
com.kodedu.terminalfx
terminalfx
1.2.0com.kodedu.terminalfx
terminalfx
1.0.8----
== Compile & Run
[source,bash]
----
git clone https://github.com/rahmanusta/TerminalFX
cd TerminalFX
mvn clean install
mvn javafx:run
----== Run as Java Module (Java 17)
The following modules have to be added in JVM parameters
----
--add-modules=javafx.controls,javafx.graphics
----== Run command
You can run commands:
[source,bash]
----
terminal.onTerminalFxReady(() -> {
terminal.getTerminal().command("java -version\r");
});
----== Licence
This project is licensed under the MIT license. See link:LICENSE[LICENSE] for more information.