Terminal emulator for the Godot game engine.
Find a file
Leroy Hopson 399acf00c7 Use alloc_c_string() to convert String to char*
Using get_data() would sometimes result in the wrong data being written.

Fixes #12
2020-11-07 18:13:48 +07:00
.github/workflows Migrate CI from travis-ci.com to GitHub Actions 2020-11-07 17:11:25 +07:00
addons/godot_xterm Use alloc_c_string() to convert String to char* 2020-11-07 18:13:48 +07:00
dockerfiles Migrate CI from travis-ci.com to GitHub Actions 2020-11-07 17:11:25 +07:00
docs Bump version to 1.0.0 2020-10-05 18:16:17 +07:00
examples Multiple changes 2020-10-05 17:56:57 +07:00
.dockerignore Migrate CI from travis-ci.com to GitHub Actions 2020-11-07 17:11:25 +07:00
.gitignore Initial commit 2020-05-09 23:49:45 +07:00
.gitmodules Update build script 2020-10-13 16:12:16 +07:00
.gutconfig.json Travis CI integration 2020-05-10 17:23:58 +12:00
CHANGELOG.md Use alloc_c_string() to convert String to char* 2020-11-07 18:13:48 +07:00
default_env.tres Basics working, added pseudoterminal 2020-10-05 17:56:21 +07:00
docker-compose.yml Migrate CI from travis-ci.com to GitHub Actions 2020-11-07 17:11:25 +07:00
icon.png Change to the old icon 2020-10-05 18:16:17 +07:00
icon.png.import Add all the files 2020-05-10 01:42:19 +07:00
LICENSE Update documentation and LICENSE 2020-10-05 18:04:41 +07:00
project.godot Multiple changes 2020-10-05 17:56:57 +07:00
README.md Migrate CI from travis-ci.com to GitHub Actions 2020-11-07 17:11:25 +07:00

GodotXterm

Version Godot Version License Build Status

Terminal emulator for Godot using GDNative and libtsm.

Note: If you are looking for the purely gdscript version of this plugin which was based on Xterm.js, it turned out to be too buggy and slow so is no longer being developed or maintained but can still be found in the gdscript-unmaintaned branch.

Screenshot of Main Menu Scene

Supported Platforms

Confirmed:

  • Linux 64-bit (primarily developed/tested on this platform)
  • Windows 64-bit

Planned/untested:

  • Linux 32-bit
  • Windows 32-bit
  • MacOS 64-bit

Building

Important: It is recommended that you build the native binaries before opening this demo project, otherwise the Godot editor will automatically modify the example scenes when it can't find the native libs, such that they won't work when the files are in place.

If you prefer not to build your own binaries from source, there are some pre-compiled release binaries in the dist directory. They can be copied to the correct location by:

cd addons/godot_xterm/native
cp -rf dist/* bin/

All Operating Systems

You will need at least these dependencies in order to build this plugin:

  • Git (for git submodules)
  • a C++ compiler (e.g. gcc)
  • ar (part of GNU Binutils)
  • CMake
  • Python
  • SCons

Linux

NixOS

You can simply run the build.sh script in the addons/godot_xterm/native directory:

addons/godot_xterm/native/build.sh

All dependencies will be pulled in by nix-shell and the build steps will run.

Arch Linux and Ubuntu

See the Arch Linux Dockerfile and Ubuntu Dockerfile for a list of packages that need to be installed. Once installed, run the build.sh script in the addons/godot_xterm/native directory:

addons/godot_xterm/native/build.sh

Other Linux Distributions

Will probably be similar to the above. When in doubt check the documentation in the submodule repos, the build.sh script, and the SConstruct file.

Other Operating Systems

This plugin is not currently supported for other operating systems (e.g. MacOS, Windows). If you manage to build it on one of these platforms, please submit a PR for this readme.

Usage

  • Terminal

    The main node provided by this plugin.

  • Pseudoterminal

    A node that can be used to connect the Terminal to a shell. Currently Linux only.

    An example of how to use this node with a Terminal can be found in the terminal scene.

  • TPut

    An incomplete helper class based on the tput utility.

    Example: On the command line you can use tput cup 5 5 to position the cursor at row 5 col 5. In GDScript this utility can be used to similar effect by doing:

    tput.cup(5, 5)
    

    Other commands include tput setaf to set a foreground color, tput setab to set a background color, and many more. But only a few of these have been implemented.

    Its usage is demonstrated in the script for the menu scene.

  • Asciicast (.cast) file importer plugin

    Asciinema recordings saved with the .cast extension will be automatically imported as animations. They can then be added to AnimationPlayer which is a child of a Terminal node. Playing the animation will play the terminal session recording in the parent Terminal.

    See the asciicast scene for an example.

Examples

There are three example scenes included in this project which you can study to learn more.

  • menu.tscn
  • terminal.tscn
  • asciicast.tscn

License

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work, or unoriginal work which is published under a compatible license or waiver.

Copyright (c) 2020 The GodotXterm authors (MIT License)

The fonts used in this project are published under a seperate license. See the various license files in the subdirectories for each font.