1 Star 1 Fork 0

tony_li / TerminalFX

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

JavaFX Terminal Emulator

1. JavaFX Terminal Emulator

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

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 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>

6. Compile & Run

git clone https://github.com/rahmanusta/TerminalFX
cd TerminalFX
mvn clean install
mvn javafx:run

7. Run as Java Module (Java 12)

The following modules have to be added in JVM parameters

--add-modules=javafx.controls,javafx.graphics

8. Run command

You can run commands:

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

9. Licence

This project is licensed under the MIT license. See LICENSE for more information.

MIT License Copyright (c) 2018 javaterminal Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个简单的命令行工具 展开 收起
Java 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/lilongyang/TerminalFX.git
git@gitee.com:lilongyang/TerminalFX.git
lilongyang
TerminalFX
TerminalFX
master

搜索帮助