Move documentation from wiki to main repo

Makes it easier to keep documentation up to date and can deploy with
GitHub pages.

README.md moved to docs/README.md and is shared with GitHub Pages home
page.
This commit is contained in:
Leroy Hopson 2022-08-07 22:49:29 +12:00
parent 66254ea17e
commit 6f89edc14e
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
36 changed files with 4544 additions and 143 deletions

3
.gitmodules vendored
View file

@ -1,6 +1,3 @@
[submodule "docs/wiki"]
path = docs/wiki
url = https://github.com/lihop/godot-xterm.wiki
[submodule "addons/godot_xterm/native/thirdparty/godot-cpp"]
path = addons/godot_xterm/native/thirdparty/godot-cpp
url = https://github.com/godotengine/godot-cpp

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020-2021, Leroy Hopson <<godotxterm@leroy.geek.nz>> and [contributors](https://github.com/lihop/godot-xterm/contributors).
Copyright (c) 2020-2022, Leroy Hopson <<godotxterm@leroy.geek.nz>> and [contributors](https://github.com/lihop/godot-xterm/contributors).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,95 +0,0 @@
<img align="left" width="64" height="64" src="icon.png">
# GodotXterm
![Godot Version](https://img.shields.io/badge/Godot-3.3+-blue.svg)
![License](https://img.shields.io/badge/License-MIT-green.svg)
[![Build and Test](https://github.com/lihop/godot-xterm/actions/workflows/main.yml/badge.svg?event=schedule)](https://github.com/lihop/godot-xterm/actions/workflows/main.yml)
GDNative terminal for Godot.
Built using [libtsm](https://www.freedesktop.org/wiki/Software/libtsm/), [libuv](https://github.com/libuv/libuv), and [node-pty](https://github.com/microsoft/node-pty).
Primarily developed and tested on Linux, it also supports macOS with partial support for Windows and HTML5. See the [Features](#features) section for more detail.
https://user-images.githubusercontent.com/3696783/126894061-a69eb6ad-9979-4723-ade7-829494a9fc87.mp4
## [Documentation](https://github.com/lihop/godot-xterm/wiki)
Documentation is available in [the wiki](https://github.com/lihop/godot-xterm/wiki).
If you have a question not answered by the docs, or would like more support, feel free to open a new discussion in the [discussions](https://github.com/lihop/godot-xterm/discussions) section of this project.
## Features
- ### [Terminal](https://github.com/lihop/godot-xterm/wiki/Terminal)
A Terminal emulator Control node.
Supports ANSI and (some) XTerm Control Sequences which can be used to do things such as clear the screen, move the cursor, change printed text color, ring a bell, and so on.
For an exhaustive list of terminal control sequences (not all of which are supported by GodotXterm) see <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html>.
- ### [PTY](https://github.com/lihop/godot-xterm/wiki/PTY)
*Linux and macOS only.*
Node for forking processes (e.g. bash, nodejs, python) with pseudoterminal file descriptors.
Can be used with the Terminal node to get an actual shell.
Not currently supported on Windows, but it could be in the future using [ConPTY](https://docs.microsoft.com/en-us/windows/console) or [WinPTY](https://github.com/rprichard/winpty).
See issue [\#25](https://github.com/lihop/godot-xterm/issues/25).
- ### Terminal Editor Plugin
*Linux and macOS only.*
Adds a panel to the Editor's bottom panel that can be used to spawn terminals in the editor.
Similar to VSCode's integrated terminal and IntelliJ's embedded terminal.
- ### Asciicast Import Plugin
Adds support for importing asciinema v2 `.cast` files as animations that can be played by an AnimationPlayer that is a child of a Terminal node.
Example `.cast` files can be downloaded from the [asciinema website](https://asciinema.org).
- ### Xresources Import Plugin
Adds support for importing color schemes from `.xrdb` or `.Xresources` files.
Example xresources files can be exported from [terminal.sexy](https://terminal.sexy).
The [iTerm2-Color-Schemes repo](https://github.com/mbadolato/iTerm2-Color-Schemes) also has many example color scheme files in [xrdb](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/xrdb) and [Xresources](https://github.com/mbadolato/iTerm2-Color-Schemes) format.
## Installation
GodotXterm is available on the Godot Asset Library: <https://godotengine.org/asset-library/asset/1007>.
For more ways to install see the [Installation](https://github.com/lihop/godot-xterm/wiki/Installation) page on the wiki.
## Demos
- [Online demo](https://lihop.github.io/godot-xterm-dist/) of an HTML5 export of this repo (using the GDNative export type, available since Godot 3.3).
Make sure you click the screen at least once after loading.
- [Xterminate](https://lihop.itch.io/xterminate). A Linux, macOS, and Windows demo, which uses an older version GodotXterm in conjunction with [Godot Python](https://github.com/touilleMan/godot-python).
- This repository also contains a number of demo scenes in the [`examples`](/examples) directory. The easiest way to run these scenes is to clone this repo and then download the `libgodot-xterm-release.zip` archive from the [Releases](https://github.com/lihop/godot-xterm/releases) section and extract its contents (`.so`, `.wasm`, `.dll`, and `.dylib` files) into the `addons/godot_xterm/native/bin` directory.
## [License](/LICENSE.md)
Copyright (c) 2020-2021, Leroy Hopson and [contributors](https://github.com/lihop/godot-xterm/graphs/contributors) (MIT License).
### Third-party components
The GDNative source code incorporates code snippets and source code from many third-party libraries. The licenses of these components can be found in the various sub-directories of this project (provided git submodules have been cloned). Many of these licenses must be distributed with source and binary distributions of this software. For convenience, the texts of these licenses have been bundled together (but clearly demarcated) in the [THIRDPARTY_NOTICES.txt](/addons/godot_xterm/THIRDPARTY_NOTICES.txt) file.
**Note:** On platforms where the PTY node is not supported or if the library has been compiled with the option `disable_pty=yes` then only the licenses bundled in [THIRDPARTY_NOTICES_nopty.txt](/addons/godot_xterm/THIRDPARTY_NOTICES_nopty.txt) are applicable.
### Fonts
- The Hack regular font is bundled with GodotXterm as the default Terminal font. This is also the default monospace font of the Godot editor. See the [full license](/addons/godot_xterm/themes/fonts/hack/LICENSE.md).
### Nonbundled Resources
The following resources are not bundled with GodotXterm (i.e. are not included in the `addons/godot_xterm` directory) but are included in this repository for demo and testing purposes. They are:
#### Sounds
- [bell.wav](/themes/audio/bell.wav) by InspectorJ (<https://www.jshaw.co.uk>), downloaded from [freesound.org](https://freesound.org/people/InspectorJ/sounds/484344/), released under [CC-BY-3.0](https://creativecommons.org/licenses/by/3.0/).
#### Fonts
- The **bold**, *italic*, and ***bold italic*** styles of the Hack font which are covered by the same license as above.
- Nerd Fonts. Combines symbols from a multitude of other fonts. See [license information](/themes/fonts/nerd_fonts/README.md).
- Noto Color Emoji. Released under the [SIL Open Font License](/themes/fonts/noto_color_emoji/LICENSE_OFL.txt).
- Unifont. Dual-licensed (since version 13.0.04) under the GNU GPL 2+ with the GNU font embedding exception and the SIL Open Font License (OFL) version 1.1. This project uses it under the terms of the [SIL Open Font License](/themes/fonts/unifont/LICENSE_OFL-1.1.txt).

5
docs/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor

25
docs/404.html Normal file
View file

@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>

2
docs/Gemfile Normal file
View file

@ -0,0 +1,2 @@
source "https://rubygems.org"
gem "github-pages", "~> 227", group: :jekyll_plugins

261
docs/Gemfile.lock Normal file
View file

@ -0,0 +1,261 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.5.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.23.5)
concurrent-ruby (1.1.10)
dnsruby (1.61.9)
simpleidn (~> 0.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.15.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.8.1)
faraday (2.4.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.1.0)
ffi (1.15.5)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (227)
github-pages-health-check (= 1.17.9)
jekyll (= 3.9.2)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.2.0)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
jekyll-include-cache (= 0.2.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.16.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.8.0)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.2.0)
jekyll-theme-cayman (= 0.2.0)
jekyll-theme-dinky (= 0.2.0)
jekyll-theme-hacker (= 0.2.0)
jekyll-theme-leap-day (= 0.2.0)
jekyll-theme-merlot (= 0.2.0)
jekyll-theme-midnight (= 0.2.0)
jekyll-theme-minimal (= 0.2.0)
jekyll-theme-modernist (= 0.2.0)
jekyll-theme-primer (= 0.6.0)
jekyll-theme-slate (= 0.2.0)
jekyll-theme-tactile (= 0.2.0)
jekyll-theme-time-machine (= 0.2.0)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.12.0)
kramdown (= 2.3.2)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.3)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.13.6, < 2.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
github-pages-health-check (1.17.9)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (>= 3.0, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.2)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.9.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-avatar (0.7.0)
jekyll (>= 3.0, < 5.0)
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.4.0)
commonmarker (~> 0.22)
jekyll-commonmark-ghpages (0.2.0)
commonmarker (~> 0.23.4)
jekyll (~> 3.9.0)
jekyll-commonmark (~> 1.4.0)
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-theme-architect (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.6.0)
jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.0)
jekyll-theme-slate (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.2)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.16.2)
nokogiri (1.13.8-x86_64-linux)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.0)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.10)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
zeitwerk (2.6.0)
PLATFORMS
x86_64-linux
DEPENDENCIES
github-pages (~> 227)
BUNDLED WITH
2.3.19

130
docs/README.md Normal file
View file

@ -0,0 +1,130 @@
<img align="left" width="64" height="64" src="./media/icon.png">
# GodotXterm - Terminal Emulator
<br/>
[![Godot Version](https://img.shields.io/badge/Godot-3.3+-blue.svg)](https://godotengine.org)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/lihop/godot-xterm/blob/stable/LICENSE.md)
[![Build and Test](https://github.com/lihop/godot-xterm/actions/workflows/main.yml/badge.svg?event=schedule)](https://github.com/lihop/godot-xterm/actions/workflows/main.yml)
GDNative terminal for Godot.
Built using [libtsm](https://www.freedesktop.org/wiki/Software/libtsm/), [libuv](https://github.com/libuv/libuv), and [node-pty](https://github.com/microsoft/node-pty).
Primarily developed and tested on Linux, it also supports macOS with partial support for Windows and HTML5. See the [Features section](#features) for more detail.
<video width="100%" controls>
<source src="https://user-images.githubusercontent.com/3696783/126894061-a69eb6ad-9979-4723-ade7-829494a9fc87.mp4" />
</video>
<div id="video-preview">
https://user-images.githubusercontent.com/3696783/126894061-a69eb6ad-9979-4723-ade7-829494a9fc87.mp4
</div>
[![Live Demo](./media/live_demo_button.png)](https://lihop.github.io/godot-xterm-dist/)
[![View it on GitHub](./media/view_it_on_github_button.png)](https://github.com/lihop/godot-xterm)
#### Table of Contents
1. [Features](#features)
2. [Screenshots](#screenshots)
3. [Demos and Examples](#demos-and-examples)
4. [Installation](#installation)
5. [Documentation](#documentation)
6. [License](#license)
## Features
- ### [Terminal](https://lihop.github.io/godot-xterm/api/terminal)
A Terminal emulator Control node.
Supports ANSI and (some) XTerm Control Sequences which can be used to do things such as clear the screen, move the cursor, change printed text color, ring a bell, and so on.
For an exhaustive list of terminal control sequences (not all of which are supported by GodotXterm) see ["XTerm Control Sequences"](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html).
- ### [PTY](https://lihop.github.io/godot-xterm/api/pty)
*Linux and macOS only.*
Node for forking processes (e.g. bash, nodejs, python) with pseudoterminal file descriptors.
Can be used with the Terminal node to get an actual shell.
Not currently supported on Windows, but it could be in the future using [ConPTY](https://docs.microsoft.com/en-us/windows/console) or [WinPTY](https://github.com/rprichard/winpty).
See issue [\#25](https://github.com/lihop/godot-xterm/issues/25).
- ### Terminal Editor Plugin
*Linux and macOS only.*
Adds a panel to the Editor's bottom panel that can be used to spawn terminals in the editor.
Similar to VSCode's integrated terminal and IntelliJ's embedded terminal.
- ### Asciicast Import Plugin
Adds support for importing asciinema v2 `.cast` files as animations that can be played by an AnimationPlayer that is a child of a Terminal node.
Example `.cast` files can be downloaded from the [asciinema website](https://asciinema.org).
- ### Xresources Import Plugin
Adds support for importing color schemes from `.xrdb` or `.Xresources` files.
Example xresources files can be exported from [terminal.sexy](https://terminal.sexy).
The [iTerm2-Color-Schemes repo](https://github.com/mbadolato/iTerm2-Color-Schemes) also has many example color scheme files in [xrdb](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/xrdb) and [Xresources](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/Xresources) format.
## Screenshots
| | |
|--------------------------------------|--------------------------------------|
|![](./media/screenshot_editor.png) |![](./media/screenshot_the_guest.png) |
|![](./media/screenshot_retro_term.jpg)|![](./media/screenshot_xterminate.png)|
## Demos and Examples
The GodotXterm repository contains several example scenes in the [`/examples`](https://github.com/lihop/godot-xterm/tree/stable/examples) directory.
After cloning this repo you will need to either build the GDNative binaries from source or copy pre-compiled binaries into your project.
See the [Setup section](https://lihop.github.io/godot-xterm/setup) for more details.
Other examples of GodotXterm usage are available online:
- [**Live Demo**](https://lihop.github.io/godot-xterm-dist/): An HTML5 export of the GodotXterm repo's example scenes.
- [**The Guest**](https://lihop.itch.io/the-guest): A Linux only submission to the [Linux Game Jam 2022](https://itch.io/jam/linux-game-jam-2022). Uses GodotXterm in conjunction with the [gdtemu addon](https://github.com/lihop/gdtemu) and Linux's Kernel-based Virtual Machine, to provide the player with interactive VM that can be used in the game world.
- [**Xterminate**](https://lihop.itch.io/xterminate): A Linux, macOS, and Windows demo which uses an older version GodotXterm in conjunction with [Godot Python](https://github.com/touilleMan/godot-python).
Are you using GodotXterm in your project and want it listed here? Please [open a pull request](https://github.com/lihop/godot-xterm/pulls) to have it added.
## Installation
GodotXterm is available on the [Godot Asset Library](https://godotengine.org/asset-library/asset/1007).
For more ways to install see the [Setup section](https://lihop.github.io/godot-xterm/setup).
## Documentation
Documentation is available on [GitHub Pages](https://lihop.github.io/godot-xterm).
If you have a question not answered by the docs, or would like more support, feel free to open a new discussion in the [discussions](https://github.com/lihop/godot-xterm/discussions) section of this project.
## License
Copyright (c) 2020-2022, Leroy Hopson and [contributors](https://github.com/lihop/godot-xterm/graphs/contributors) (MIT License).
See the [full license](https://github.com/lihop/godot-xterm/blob/stable/LICENSE.md).
### Third-party components
The GDNative source code incorporates code snippets and source code from many third-party libraries. The licenses of these components can be found in the various sub-directories of this project (provided git submodules have been cloned). Many of these licenses must be distributed with source and binary distributions of this software. For convenience, the texts of these licenses have been bundled together (but clearly demarcated) in the [THIRDPARTY_NOTICES.txt](https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/THIRDPARTY_NOTICES.txt) file.
**Note:** On platforms where the PTY node is not supported or if the library has been compiled with the option `disable_pty=yes` then only the licenses bundled in [THIRDPARTY_NOTICES_nopty.txt](https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/THIRDPARTY_NOTICES_nopty.txt) are applicable.
### Fonts
- The Hack regular font is bundled with GodotXterm as the default Terminal font. This is also the default monospace font of the Godot editor. See the [full license](https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/themes/fonts/hack/LICENSE.md).
### Nonbundled Resources
The following resources are not bundled with GodotXterm (i.e. are not included in the `addons/godot_xterm` directory) but are included in this repository for demo and testing purposes. They are:
#### Sounds
- [bell.wav](https://github.com/lihop/godot-xterm/blob/stable/themes/audio/bell.wav) by [InspectorJ](https://www.jshaw.co.uk), downloaded from [freesound.org](https://freesound.org/people/InspectorJ/sounds/484344/), released under [CC-BY-3.0](https://creativecommons.org/licenses/by/3.0/).
#### Fonts
- The **bold**, *italic*, and ***bold italic*** styles of the Hack font which are covered by the same license as above.
- Nerd Fonts. Combines symbols from a multitude of other fonts. See [license information](https://github.com/lihop/godot-xterm/blob/stable/themes/fonts/nerd_fonts/README.md).
- Noto Color Emoji. Released under the [SIL Open Font License](https://github.com/lihop/godot-xterm/blob/stable/themes/fonts/noto_color_emoji/LICENSE_OFL.txt).
- Unifont. Dual-licensed (since version 13.0.04) under the GNU GPL 2+ with the GNU font embedding exception and the SIL Open Font License (OFL) version 1.1. This project uses it under the terms of the [SIL Open Font License](https://github.com/lihop/godot-xterm/blob/stable/themes/fonts/unifont/LICENSE_OFL-1.1.txt).

12
docs/_config.yml Normal file
View file

@ -0,0 +1,12 @@
# Site settings.
title: GodotXterm
email: godotxterm@leroy.geek.nz
description: Terminal emulator for the Godot game engine.
github_username: lihop
# Build settings.
remote_theme: just-the-docs/just-the-docs
# Just-the-docs settings.
color_scheme: dark
logo: /media/logo.png

View file

@ -0,0 +1 @@
#video-preview { display: none; }

9
docs/api/api.md Normal file
View file

@ -0,0 +1,9 @@
---
layout: default
title: API
nav_order: 3
has_children: true
permalink: /api
---
# API

201
docs/api/pty.md Normal file
View file

@ -0,0 +1,201 @@
---
layout: default
title: PTY
parent: API
nav_order: 1
permalink: /api/pty
---
# PTY
**Inherits:** [Node] < [Object]
*Linux and macOS only.*
Node for forking processes (e.g. bash, nodejs, python) with pseudoterminal file descriptors.
Can be used with the [Terminal] node to get an actual shell.
Not currently supported on Windows, but it could be in the future using [ConPTY](https://docs.microsoft.com/en-us/windows/console) or [WinPTY](https://github.com/rprichard/winpty).
See issue [\#25](https://github.com/lihop/godot-xterm/issues/25).
## Overview
![PTY Diagram](/media/pty_diagram.png)
<sub>"PTY Diagram" is a derivative of [Termios-script-diagram.svg](https://commons.wikimedia.org/wiki/File:Termios-script-diagram.svg) by [Krishnavedala](https://en.wikipedia.org/wiki/User:Krishnavedala?rdfrom=commons:User:Krishnavedala), used under [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/).
## Properties
| Type | Name | Default |
|--------------|--------------------------------------|--------------------------------------------------------|
| [NodePath] | [terminal_path](#prop-terminal_path) | None |
| [int] | [cols](#prop-cols) | `80` |
| [int] | [rows](#prop-rows) | `24` |
| [Dictionary] | [env](#prop-env) | `{ COLORTERM = "truecolor", TERM = "xterm-256color" }` |
| [bool] | [use_os_env](#prop-use_os_env) | `true` |
## Methods
| Returns | Signature |
|---------|-------------------------------------------------------------------------------------------------------------------------------------|
| [Error] | [fork](#mthd-fork) **(** [String] file=`$SHELL`, [PoolStringArray] args=[], [String] cwd=`$PWD`, [int] cols=80, [int] rows=24 **)** |
| void | [kill](#mthd-kill) **(** [int] signum **)** |
| [Error] | [open](#mthd-open) **(** [int] cols=80, [int] rows=24 **)** |
| void | [resize](#mthd-resize) **(** [int] cols, [int] rows **)** |
| void | [resizev](#mthd-resizev) **(** [Vector2] size **)** |
| void | [write](#mthd-write) **(** [String]\|[PoolByteArray] data **)** |
## Signals
- <a name="sgnl-data_received" /> **data_received** **(** [PoolByteArray] data **)**
Emitted when data is read from the pseudoterminal master device.
---
- <a name="sgnl-exited" /> **exited** **(** [int] exit_code, [int] signum **)**
Emitted when the child program exits. `exit_code` is the exit status of the child program and `signum` is the number of the signal that terminated the child program.
## Enumerations
### <a name="enum-signal" /> enum **Signal**:
- **SIGHUP** = 1 --- Hangup.
- **SIGINT** = 2 --- Terminal interrupt signal.
- **SIGQUIT** = 3 --- Terminal quit signal.
- **SIGILL** = 4 --- Illegal instruction.
- **SIGTRAP** = 5 --- Trace/breakpoint trap.
- **SIGABRT** = 6 --- Process abort signal.
- **SIGFPE** = 8 --- Erroneous arithmetic operation.
- **SIGKILL** = 9 --- Kill (cannot be caught or ignored).
- **SIGSEGV** = 11 --- Invalid memory reference.
- **SIGPIPE** = 13 --- Write on a pipe with no one to read it.
- **SIGALRM** = 14 --- Alarm clock.
- **SIGTERM** = 15 --- Termination signal.
## Property Descriptions
### <a name="prop-terminal_path" /> [NodePath] **terminal_path**
| | |
|-----------|--------------------------|
| *Default* | None |
| *Setter* | set_terminal_path(value) |
| *Getter* | None |
[NodePath] to a [Terminal]. Setting this path will automatically connect the appropriate signals of both nodes for standard operation. It will also disconnected the signals of the previously set terminal, if any.
---
- <a name="prop-cols" /> [int] **cols**
| | |
|-----------|--------------------------|
| *Default* | `80` |
| *Setter* | set_cols(value) |
| *Getter* | None |
The column size in characters.
---
- <a name="prop-rows" /> [int] **rows**
| | |
|-----------|--------------------------|
| *Default* | `24` |
| *Setter* | set_rows(value) |
| *Getter* | None |
The row size in characters.
---
- <a name="prop-env" /> [Dictionary] **env**
| | |
|-----------|--------------------------------------------------------|
| *Default* | `{ COLORTERM = "truecolor", TERM = "xterm-256color" }` |
| *Setter* | None |
| *Getter* | None |
Environment variables to be set for the child program.
---
- <a name="prop-use_os_env" /> [bool] **use_os_env**
| | |
|-----------|--------|
| *Default* | `true` |
| *Setter* | None |
| *Getter* | None |
If `true` the environment variables from `env` will be merged with the environment variables of the current program (i.e. Godot), with the variables from `env` taking precedence over the environment variables of the current program.
## Method Descriptions
- <a name="mthd-fork" /> [Error] **fork** **(** [String] file=`$SHELL`, [PoolStringArray] args=[], [String] cwd=`$PWD`, [int] cols=80, [int] rows=24 **)**
{ .red }
Opens a pseudoterminal and starts a new process using the program specified by `file`.
`file` defaults to the value of the `SHELL` environment variable, falling back to `sh`.
The arguments specified in `args` are passed to the program.
`cwd` is the directory in which the program will be executed. Defaults to the working directory of the current program (typically the project directory, when running from editor).
`cols` is the initial number of columns and `rows` is the initial number of rows.
Returns [OK] if successful.
See also Godot's [OS.execute()](https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-execute) method.
---
- <a name="mthd-kill" /> void **kill** **(** [int] signum=1 **)**
Sends the specified signal (`signum`) to the PTY's child process, if any. Defaults to 1 (SIGHUP).
See also Godot's [OS.kill()](https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-kill) method.
---
- <a name="mthd-open" /> [Error] **open** **(** [int] cols=80, [int] rows=24 **)**
Opens a pseudoterminal but does not start any process. Returns [OK] if successful.
---
- <a name="mthd-resize" /> void **resize** **(** [int] cols, [int] rows **)**
Resizes the dimensions of the pseudoterminal.
---
- <a name="mthd-resizev" /> void **resizev** **(** [Vector2] size **)**
Same as resize, but accepts a [Vector2] where `x` is cols and `y` is rows.
---
- <a name="mthd-write" /> void **write** **(** [String] \| [PoolByteArray] data **)**
Writes data to the pseudoterminal master device.
[Dictionary]: https://docs.godotengine.org/en/stable/classes/class_dictionary.html
[Error]: https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#enum-globalscope-error
[Node]: https://docs.godotengine.org/en/stable/classes/class_node.html
[NodePath]: https://docs.godotengine.org/en/stable/classes/class_nodepath.html
[Object]: https://docs.godotengine.org/en/stable/classes/class_object.html
[OK]: https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#class-globalscope-constant-ok
[PoolByteArray]: https://docs.godotengine.org/en/stable/classes/class_poolbytearray.html
[PoolStringArray]: https://docs.godotengine.org/en/stable/classes/class_poolstringarray.html
[String]: https://docs.godotengine.org/en/stable/classes/class_string.html
[Terminal]: /api/terminal
[Vector2]: https://docs.godotengine.org/en/stable/classes/class_vector2.html
[bool]: https://docs.godotengine.org/en/stable/classes/class_bool.html
[int]: https://docs.godotengine.org/en/stable/classes/class_int.html

225
docs/api/terminal.md Normal file
View file

@ -0,0 +1,225 @@
---
layout: default
title: Terminal
parent: API
nav_order: 2
permalink: /api/terminal
---
# Terminal
**Inherits:** [Control] < [CanvasItem] < [Node] < [Object]
A Terminal emulator Control node.
Supports ANSI and (some) XTerm Control Sequences which can be used to do things such as clear the screen, move the cursor, change printed text color, ring a bell, and so on.
For an exhaustive list of terminal control sequences (not all of which are supported by GodotXterm) see ["XTerm Control Sequences"](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html).
## Overview
![Terminal Flow Diagram](/media/flow_diagram.svg)
<sub>"Terminal Flow Diagram" is a derivative of ["computer keyboard 2"](https://openclipart.org/detail/2396/computer-keyboard-2) and ["monitor"](https://openclipart.org/detail/1637/monitor), from U.S. patent drawings, uploaded by [johnny_automatic](https://openclipart.org/artist/johnny_automatic), used under [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/).<sub/>
### (1) User Input
The user enters some data into the terminal, typically by typing something on the keyboard.
This corresponds to the `_gui_input()` method.
### (2) Terminal Output
The user input from (1) is processed by the terminal state machine and converted to the appropriate output.
For example, if the user were to press the downwards arrow key (↓), the terminal would then emit `data_sent()`
with the value `"\u001b[A"`.
### (3) Terminal Input
In the other direction, data can be sent to the terminal. This corresponds to the `write()` method.
### (4) Draw
The input from (3) is then interpreted by the terminal state machine and drawn to the screen.
For example if the string `"\u001b[38;2;0;255;0;mA"` was written to the terminal, then it would draw a green colored capital letter 'A' on the screen.
## Properties
| Type | Name | Default |
|--------------|--------------------------------------|---------|
| [bool] | [bell_muted](#prop-bell_muted) | `false` |
| [float] | [bell_cooldown](#prop-bell_cooldown) | `0.1` |
| [int] | [cols](#prop-cols) | `2` |
| [int] | [rows](#prop-rows) | `2` |
| [UpdateMode] | [update_mode](#prop-update_mode) | `AUTO` |
## Methods
| Returns | Signature |
|----------|-----------------------------------------------------------------|
| void | [clear](#mthd-clear) **()** |
| [String] | [copy_all](#mthd-copy_all) **()** |
| [String] | [copy_selection](#mthd-copy_selection) **()** |
| void | [write](#mthd-write) **(** [String]\|[PoolByteArray] data **)** |
## Signals
- <a name="sgnl-bell" /> **bell** **()**
Emitted when the [bell character](https://en.wikipedia.org/wiki/Bell_character) (`"\u0007"`) is written to the terminal.
---
- <a name="sgnl-data_sent" /> **data_sent** **(** [PoolByteArray] data **)**
Emitted when some data comes out of the terminal.
This typically occurs when the user interacts with the terminal by typing on the keyboard.
Input can be interpreted differently depending on modifier keys and the terminal's settings/state.
When connected to a [PTY], this data will be forwarded to it.
---
- <a name="sgnl-key_pressed" /> **key_pressed** **(** [String] data, [InputEventKey] event **)**
Emitted when a key is pressed. `data` is the data that would be emitted by the terminal via the [`data_sent()`](#sgnl-data_sent) signal and may vary based on the terminal's state. `event` is the event captured by Godot in the `_gui_input(event)` method.
---
- <a name="sgnl-size_changed"> **size_changed** **(** [Vector2] new_size **)**
Emitted when the terminal's size changes, typically in response to its `rect_size` changing.
`new_size.x` will be the number of columns and `new_size.y` will be the number of rows.
This information should be forwarded to a pseudoterminal, if it is connected, so that it can update its size accordingly.
## Enumerations
<a name="enum-update_mode" /> enum **UpdateMode**:
- **DISABLED** = **0** --- The terminal's `update()` method will never be called. No new cells will be drawn.
- **AUTO** = **1** --- Only changed cells will be drawn after `update()` is called, but will switch to **ALL_NEXT_FRAME** when mass redraws are required.
- **ALL** = **2** --- Every cell will be drawn on every `update()` call.
- **ALL_NEXT_FRAME** = **3** --- Draws every cell afetr the next `update()` call, then returns to **AUTO**.
## Property Descriptions
- <a name="prop-rows" /> [int] **rows**
| | |
|-----------|------------|
| *Default* | `2` |
| *Setter* | None |
| *Getter* | None |
The number of rows in the terminal's rect.
When using a monospace font, this is typically the number of characters that can fit from the top to the bottom.
It will automatically update as the Control's rect_size changes, and therefore shouldn't be used to set the size of the terminal directly.
---
- <a name="prop-cols" /> [int] **cols**
| | |
|-----------|------------|
| *Default* | `2` |
| *Setter* | None |
| *Getter* | None |
The number of columns in the terminal's rect.
When using a monospace font, this is typically the number of characters that can fit from one side to another.
It will automatically update as the Control's rect_size changes, and therefore shouldn't be used to set the size of the terminal directly.
---
- <a name="prop-bell_muted" /> [bool] **bell_muted**
| | |
|-----------|---------|
| *Default* | `false` |
| *Setter* | None |
| *Getter* | None |
If muted, no [`bell`](#sgnl-bell) signal will be emitted when the bell character (`"\u0007"`) is written to the terminal.
---
- <a name="prop-bell_cooldown" /> [float] **bell_cooldown**
| | |
|-----------|-------|
| *Default* | `0.1` |
| *Setter* | None |
| *Getter* | None |
The minimum amount of time to wait before emitting another [`bell`](#sgnl-bell) signal on subsequent writes of the bell character.
Writing the bell character too frequently, for example by running the command `while true; do echo -e "\a"; done`,
can have a negative impact on performance depending on how the signal is connected.
This property allows throttling of that signal.
---
- <a name="prop-update_mode" /> [UpdateMode] **update_mode**
| | |
|-----------|------------------------|
| *Default* | `AUTO` |
| *Setter* | set_update_mode(value) |
| *Getter* | None |
Determines which cells of the terminal will be updated when its state changes.
By default `AUTO` will only update cells that changed, but will update all cells (i.e. the entire screen) on major changes,
such as terminal resize.
If you are having trouble with the terminal not updating correctly or exhibiting artifacts, you can try remedying this by setting `update_mode` to `ALL`, however, this will have a negative impact on performance.
## Method Descriptions
- <a name="mthd-clear" /> void **clear** **()**
Removes all but the bottommost row of the terminal including scrollback buffer.
---
- <a name="mthd-copy_all" /> String **copy_all** **()**
Copies all of the text in the terminal including scrollback buffer.
---
- <a name="mthd-copy_selection" /> String **copy_selection** **()**
Copies only selected (i.e. highlighted) text in the terminal.
Will return an empty string if nothing is highligted.
---
- <a name="mthd-write" /> void **write** **(** [String] \| [PoolByteArray] data **)**
Writes data to the terminal emulator. Accepts either a [String] or [PoolByteArray].
Typically it would be connected to the output of a [PTY]'s [`data_received()`](/api/pty#sgnl-data_received) signal.
Example:
```gdscript
$Terminal.write("Hello World")
$Terminal.write("Hello World".to_utf8())
$Terminal.write(PoolByteArray([0x1b, 0x9e])
```
[AudioStream]: https://docs.godotengine.org/en/stable/classes/class_audiostream.html
[CanvasItem]: https://docs.godotengine.org/en/stable/classes/class_canvasitem.html
[Color]: https://docs.godotengine.org/en/stable/classes/class_color.html
[Control]: https://docs.godotengine.org/en/stable/classes/class_control.html
[Font]: https://docs.godotengine.org/en/stable/classes/class_font.html
[InputEventKey]: https://docs.godotengine.org/en/stable/classes/class_inputeventkey.html
[Node]: https://docs.godotengine.org/en/stable/classes/class_node.html
[Object]: https://docs.godotengine.org/en/stable/classes/class_object.html
[PoolByteArray]: https://docs.godotengine.org/en/stable/classes/class_poolbytearray.html
[PTY]: /api/pty
[String]: https://docs.godotengine.org/en/stable/classes/class_string.html
[UpdateMode]: #enum-update_mode
[Vector2]: https://docs.godotengine.org/en/stable/classes/class_vector2.html
[bool]: https://docs.godotengine.org/en/stable/classes/class_bool.html
[float]: https://docs.godotengine.org/en/stable/classes/class_float.html
[int]: https://docs.godotengine.org/en/stable/classes/class_int.html

View file

@ -1,7 +0,0 @@
# Build export templates and export HTML5 release build.
pushd ../misc/export_templates
./build.sh
popd
pushd ../
godot --no-window --export "HTML5" ./docs/demo/index.html
popd

BIN
docs/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

8
docs/index.md Normal file
View file

@ -0,0 +1,8 @@
---
layout: default
title: Introduction
nav_order: 1
permalink: /
---
{% include_relative README.md %}

2988
docs/media/flow_diagram.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 383 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
docs/media/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

70
docs/media/logo.svg Normal file
View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg14110"
width="478.96622"
height="68.26667"
viewBox="0 0 478.96621 68.26667"
sodipodi:docname="logo.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
inkscape:export-filename="logo.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14114">
<rect
x="88.758728"
y="15.645499"
width="656.2558"
height="116.09487"
id="rect14602" />
</defs>
<sodipodi:namedview
id="namedview14112"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="1.2222451"
inkscape:cx="218.04137"
inkscape:cy="85.089316"
inkscape:window-width="1600"
inkscape:window-height="900"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g14116" />
<g
inkscape:groupmode="layer"
inkscape:label="Image"
id="g14116">
<image
width="68.26667"
height="68.26667"
preserveAspectRatio="none"
style="image-rendering:optimizeSpeed"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAANyAAADcgBffIlqAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAuwSURB VHic5Zt5dNTVFcc/k5lMNpJAQnaTELIhS5AgkA0DGEgAUcBoreLSnmpdqnVpgdZaj2Jta5F6TrV1 QXFBa5HNFjAkhk0wIEtEhBAhC4gkBmaykkkmyfz6x8tk5jfrbyKUkH7PeSfz3rtvuffdd99995en wjmSgZuBAiARCAe0LugHEozA90AVUASsA04qbRwNvAV0A9IgSd3ASiDKllmVTT4TWA9EAuTk5LBw 4UImTpxIeHg4Wu2VoQBGo5GGhgYOHDjA+vXr2bNnj7mqDlgA7HPULhMwAFJqaqq0bds2abCgtLRU SklJMWtDOzDFlvnoXulI06ZNkxobGy/3nC869Hq9lJubaxbCWXq13Iy3zCs/GJk3Q6/XS8nJyWYh vAHCBiQDFYC6tLSUGTNmyPZSeXk5ra2t/dyNlxeBgYFMmDBBZrt27NjB9OnTAXqAVIClgJSTkyOT VmVlpRQXF3e5rfcPTnFxcVJlZaWMt6ysLHP9YoCdgLRixQoZUWFh4WWf/MVKhYWFMt6WL19urtuu AUYApKenY40TJ07gCmoVXBcLBQmQHQPh/jDcD4w9oOuALxvg8+9g1xk4el7Qb7oZXj8M676x9JMb CxnRLocCoNsEL+6Xl40LgzkjnbdpM8Ir5fa8WPGaoKHXGkZERMiIJEly2KkKWJACy3JgdKgoO9cO W6rhVAu0GiHIByaEw/Jp4KuBxg7oMgkhrTku76+2GeKCYNFomDXCfrxPT8FfvhBj2OJsGxysh/wE +NUkS/kXdbDqazjc4JiXqKg+fyhKQ697q8TJ8dXAmwVw+9Uif7oFlu4STPU4kFdEAKyYbqEH8POW 05xqgfeOivTEJCE0a6ythOJax/PRGYSA9tfDY9cKLXt+L/zuM6HfzmDFq9bLBZ0MAd5QequFmX11 MOEd+GeFY+YBvr8Ad2yCN49Yyvw1zsd4cT8st1Hzu8a4n9ujEwXzKw7Ak26Yt4ViAawsgKwY8bvu AtywDvQdyto+WCLsAYC/t2vapTth9xlLPisGbk11Tp8RDU9mwoYT8OsdyuZjDUUC+Ok4uG2UJf/E djhvUD6IsQd+tlVoip8LDQBBs2gzNHVayl7OgzB/e9qoAFh7E3yjh7u2gMmTpe+FWwFo1fD7LEu+ qsnekClBhQ4+OOZ6C5hxqgXuL7bkw/zhb9fLaXzUsH6+6G/+RmHx+wO3ArglFeKDLPn3jznf8+7w 289gTaUy2n8dhw+tBP2jUVBotRVemwWTouD2TXCysX/zAQUCsD1nt1T3f7AzrfDZGfd0ZjxUIuyN Ga/Ngpgh8Pi1cPdYYe2Lavo/H1AggOvjLL97JChv+GEDegJ9B9xbZMmH+ELRLfDCNPioEv7s8Fbv GVwKwE8jzvK+CRmEQftfYnM1rPzKkh87HGqa4CefeHbcOYNLk2RreT2x/LdfDY9MBI0TEXebYPEO 4Sq7w+PbIS8eRgSLfGwQJA6Fr84pn48zuNQAX7U83+HB6n9QAVM/EI5J8jCYGGFJxTUw7UNlzIOw 8BV6S95HDavnir8/FC4FoLNxdIb6eNZ5lwm21giLboZJgmfLoKNbeT9PZ8PsBHGpMmNcGDx/nWfz cQSXAmjsEKpqxnA/+yiqEnzbYvnd3OkZ8wtThB/yUSVMXg2VVprw6ESYEee8rRK4FIBJggP1lnyg FkaFej5IuxXDnvgQV4fCqtlw5Jwweu1d4m7R1bsoXip4d644HfoLt8fg1lp5Pje2/4N5glA/2LQQ unpgwUa40CXKD34Py7+w0MUMgVdm9n8ctwJYfUy+De5N6/9gSqHxgjU3Qnww/HgTVDfJ65/5XH4C 3DYK7hjdv7HcCuBkI7x71JJPj4C5LqIwFwMvThd7e+lOKKm1r+/sgXu2yBfm5TwRWPEUim6DS3aK C4oZbxQIg3gpcN94eCRduNy2ITBrlDfAy+WW/FAfeGeOsAueQJEAzhtgwQZLWCoqALbfJvafEngr jDrkxYuVbO5U5uk9vVvunE2LhSV233xcQ3FApLwBpqwW8TYQLumhu+GBa1wzmB4hVtUMZze3yVHi bu/tJYKmDQ5igLZoMYqQmTWW5Xi2RRXczi2oaYbM9+GesULSKcPg7zOFQ1JcKxyVc+1CDSMDxIpk xohw1b46WHVEHh4D4RnmJ4j+gnpDdXnxcOcY0d+Rc5ZjzwxvL5gSLRZh5gh5nVoFGxaIaPB/TsLu 7y6iAED4Bm8dEcxMj4O5iZAZDblXQWGKoDlvgPoLImL77lERuKxpdtzfjUnCpf1Hubx8TKhI37ba R4SDfeCG3lW21QBrzBoBx3TueZIAqaqqSvbxIC0t7bJ/0LhYKS0tTcZbVVVVX51iGzBY4XILeKs1 eKvdhHF70W3qxtjdhUrrptcekHoDnl5eEDDEcqWTJIm2VpOThgJqX39U3uJW1t3WBA4+4Ki81KgD hFNgMroOXbsUwOK5D7N03i9ddmDGxoNbuPPVBxn2Vw0Bdzu/p3buMtEwR/i1sQlaVm0cIauXTFB9 opN1qxsp2thi137k/X8kZuFDAJT/Ipfmr/bY0YTmzGPsc2sBqF31LBzc6HQ+LgVwwWhA3yY/t4L9 g1B7qe3KWw1tsrypGYc3H5MDY9h+wURzowg2DA/XkJjqw+JlkQQFq1nzjvOIZ8iUAscCmFLgtI0t XArgpaJXeanoVVlZ2dNFjIpOIv6xCS47bsg30vW1sqvfrpI2XnhKXDu9vGDhHcN4cHEYi34eyscf NtHZad9PR10NoRlzqHnjKXmFSkVIRgEddTX4RiW4HXvAGUGTCda+18jRLw0MCfQiZYzju65ubxFD ktLwCYuRlQ9JHIdP2FXo9n6iaLwBJwAzTlQISxka5lhJ9WVbxGpPzpeVh2TMQTL10Lj/U0XjDFgB qDXiVtPZ6fhUMJytwXDmBCEZ8v0emlFAy9F9dLXoHbazxYAUgEoFY64Rqn/2dJdTOt3eTxh2bR4q jTiqNYHDCBqTgX5fkdM2trhkAojcrSW2yccuBT7qOpQbEe3Nw78JZ2SyD5Vfd3Cq2vlHP/3eIjQB QQSPEx8vQybNRKXWoCvbonieHt8FLgUK5gdRMF8ezThdY+QPS+udtBBoKt9Jj6GNkCkFNJXvJCSj AKOujraThwkel61o7EsmgPoc5cdgd5eEwSD2emCQ0JDD+9v57rTrT76mrk6ayncSmjGb6tefJGRy PrqyzQ69Q2cYEDbg082t3JRdxU3ZVdwyo5rDBwzMu3UoM2YHum2r31dEwMixhE2djzYkAv1e5fsf BogArKE7181zS+owdkosui8UlZsZ6srEeT/ygT8hdXfReKDUo/EGnAAAdA3dlGxqIT5RS2au67hb R30t7acq8IseSfORz+m+4CTw4AQDUgAAm9cJRubeHOyWtqF0DYaz1Zzbsc7jcQbEKeAIx490UP1N J5Nz/AkN16BrcP49rfbtZdS+vaxf41wyDQhd6U3ENvs0fI2y+ALA1o9bUKtVzJrXj4C/QlwyAXiP VaGd7GWf0pUH7rf+u4Uuo8TsBUGo+vNVViE6AamiokJRTDApIkEae9Uop/E3dYxK8h7nIo1S9dFq fVRSymhfKTLa22l/8YlaKWW0r6TRiHY+4bFSYGq65KX1dRkHVPsNkQJT0yWf4dF2McGKigozXSfA KUDavn27jGj8+PGXPZh5sdL48eNlvJWWlprrar2AGoBDhw7J1CI5OdmN4lw5sOXFitdqgCWAlJ2d /X/zYCIzM9Ncv1gFJAHHAXVJSQl5eXl9khqMT2aKi4vJz88H8Zaw718vVwJSSkqKpNfrpcEKnU4n JSUlmVf/NWthRSGekkm5ubmDUgg6nU6aOnWqmfkzgPyFCOIxYTsgJScnSyUlJZd7zhcNxcXF1ivf DvS9L7F1L6YAG3o1gqysrL6ns5GRkVfU09n6+vq+p7NlZWXmqrPAfMDFv16IN0SvM7geT3ch9ryd 2rtyMBORP5+P5Mp6Pl+P5fn8WnrPfFv8Fxw+C7QHZgVmAAAAAElFTkSuQmCC "
id="image14118" />
<text
xml:space="preserve"
id="text14600"
style="font-size:74.6667px;line-height:1.25;font-family:'DejaVu Serif';-inkscape-font-specification:'DejaVu Serif';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect14602);display:inline"
transform="translate(0,-23.77255)"><tspan
x="88.757812"
y="84.711231"
id="tspan1036"><tspan
style="font-family:FreeSans;-inkscape-font-specification:FreeSans;fill:#e6e1e8"
id="tspan1034">GodotXterm</tspan></tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
docs/media/pty_diagram.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

486
docs/media/pty_diagram.svg Normal file
View file

@ -0,0 +1,486 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- This file was generated by dvisvgm 1.14 -->
<svg
height="725.84851"
version="1.1"
viewBox="-71 -68 306.27861 241.9495"
width="918.83582"
id="svg802"
sodipodi:docname="pty_diagram.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
inkscape:export-filename="pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs806" />
<sodipodi:namedview
id="namedview804"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="0.75243414"
inkscape:cx="606.69762"
inkscape:cy="394.71893"
inkscape:window-width="1600"
inkscape:window-height="900"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg802"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" />
<style
type="text/css"
id="style668"><![CDATA[ text.f1 {fill:black;font-family:times;font-size:8;font-style:italic} text.f3 {fill:black;font-family:times;font-size:8} text.f5 {fill:black;font-family:courier;font-size:9} text.f7 {fill:black;font-family:times;font-size:9;font-style:italic} text.f9 {fill:black;font-family:times;font-size:9} ]]></style>
<rect
style="fill:#333f67;fill-opacity:1;stroke-width:0;paint-order:markers stroke fill"
id="rect15503"
width="85.316261"
height="97.62043"
x="-70.400002"
y="23.624069"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<rect
style="fill:#333f67;fill-opacity:1;stroke-width:0;paint-order:markers stroke fill"
id="rect15377"
width="137.86372"
height="93.743095"
x="-70.511597"
y="-66.960007"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<text
class="f7"
x="-6.9957995"
y="-22.62919"
id="text670"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:times;-inkscape-font-specification:times;fill:#e6e1e8;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">PTY</text>
<text
class="f7"
x="164.4722"
y="-21.73703"
id="text672"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">bash</text>
<text
class="f9"
x="-41.1707"
y="91.650208"
id="text674"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">Terminal</text>
<text
class="f9"
x="37.457401"
y="86.170212"
id="text678"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">Pseudo ter-<tspan
x="34.973701"
y="97.12912"
id="tspan676"
style="fill:#e6e1e8;fill-opacity:1">minal master</tspan></text>
<text
class="f9"
x="150.84489"
y="80.052208"
id="text682"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">Pseudo ter-<tspan
x="151.7998"
y="91.011124"
id="tspan680"
style="fill:#e6e1e8;fill-opacity:1">minal slave</tspan></text>
<text
class="f5"
x="136.60744"
y="101.97"
id="text684"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">(/dev/pts/...)</text>
<text
class="f9"
x="-19.4522"
y="162.47621"
id="text686"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">User</text>
<text
class="f1"
x="81.129288"
y="-16.03142"
id="text690"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">fork()</text>
<text
class="f1"
x="184.27449"
y="35.80901"
id="text692"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">Kernel space</text>
<text
class="f7"
x="186.45639"
y="21.374477"
id="text694"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">User space</text>
<text
class="f3"
x="-38.39201"
y="4.7725101"
id="text696"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">stdin</text>
<text
class="f1"
x="-0.25396016"
y="16.79611"
id="text698"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">read()</text>
<text
class="f3"
x="-21.21701"
y="59.758808"
id="text702"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">stdout<tspan
x="-21.21701"
y="67.72892"
id="tspan700"
style="fill:#e6e1e8;fill-opacity:1">stderr</tspan></text>
<text
class="f1"
x="44.240791"
y="50.493011"
id="text704"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">write()</text>
<text
class="f3"
x="128.64949"
y="15.59881"
id="text706"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">stdin()</text>
<text
class="f3"
x="164.6825"
y="56.366508"
id="text710"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">stdout<tspan
x="164.6825"
y="64.336617"
id="tspan708"
style="fill:#e6e1e8;fill-opacity:1">stderr</tspan></text>
<text
class="f3"
x="-14.075388"
y="128.31775"
id="text712"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">keyboard input</text>
<text
class="f3"
x="-65.419708"
y="134.05421"
id="text714"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">terminal output</text>
<path
d="M -34.568,-10.70469 H 42.9399 V -39.0524 H -34.568 Z"
id="path716"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 135.5146,-10.70469 c 29.85653,-0.510294 51.83826,-0.02119 77.507,0 V -39.0524 h -77.507 z"
id="path718"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
sodipodi:nodetypes="ccccc" />
<path
d="M -55.8297,102.6825 H 7.50626 V 74.3343 H -55.8297 Z"
id="path720"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="M 22.1235,102.6825 H 99.6316 V 74.3343 H 22.1235 Z"
id="path722"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 128.4246,106.6705 h 91.683 V 70.3421 h -91.683 z"
id="path724"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 34.7953,159.3735 c 0,-7.828 -20.0508,-14.172 -44.78511,-14.172 -24.73049,0 -44.78129,6.344 -44.78129,14.172 0,7.828 20.0508,14.176 44.78129,14.176 24.73431,0 44.78511,-6.348 44.78511,-14.176 z"
id="path726"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="M -70.4,121.2445 H 234.6786 V -67.4 H -70.4 Z"
stroke-width="1.2"
id="path728"
style="fill:none;stroke:#e6e1e8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 43.3383,-24.8805 h 86.3903"
stroke-dasharray="3, 3"
id="path730"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 133.8536,-24.8805 -5.851,-1.96094 1.925,1.96094 -1.925,1.96484 z"
id="path732"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;fill-opacity:1;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="M 14.916264,26.9203 H 235.2756"
stroke-dasharray="3, 3"
stroke-width="0.863383"
id="path734"
style="fill:none;stroke:#e6e1e8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 105.4166,88.5065 h 17.226"
id="path736"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 101.2916,88.5065 5.851,1.965 -1.926,-1.965 1.926,-1.961 z"
id="path738"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 126.7676,88.5065 -5.855,-1.961 1.929,1.961 -1.929,1.965 z"
id="path740"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;fill-opacity:1;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="M -38.7359,73.9359 -17.9937,-5.0993"
id="path746"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m -16.9468,-9.08749 -3.3868,5.16409 2.3907,-1.3672 1.4062,2.3672 z"
id="path748"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m -31.2047,68.725 20.81639,-79.03129"
id="path750"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m -32.2554,72.7172 3.3945,-5.1641 -2.3945,1.3672 -1.4063,-2.3672 z"
id="path752"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;fill-opacity:1;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="M 40.0649,73.9359 15.9594,-5.1539"
id="path754"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 14.7563,-9.09923 -0.1719,6.17583 1.3164,-2.418 2.4453,1.2734 z"
id="path756"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="M 47.0024,68.807 21.5531,-10.30629"
id="path758"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 48.2641,72.7367 0.0781,-6.1758 -1.2773,2.4375 -2.461,-1.2344 z"
id="path760"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;fill-opacity:1;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 147.7526,69.9437 5.32,-74.8828"
id="path762"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 153.3616,-9.05241 -2.371,5.69921 2.093,-1.7851 1.821,2.0664 z"
id="path764"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 156.1276,64.5765 5.91,-74.88279"
id="path766"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 155.7996,68.6859 2.422,-5.6836 -2.11,1.7695 -1.808,-2.0781 z"
id="path768"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m -20.189,108.3695 6.2343,31.172"
id="path770"
style="fill:none;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m -21.0015,104.3185 -0.7774,6.133 1.5508,-2.282 2.3086,1.512 z"
id="path772"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;stroke-opacity:1;fill-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m -13.1421,143.5925 0.7773,-6.137 -1.5508,2.281 -2.3047,-1.511 z"
id="path774"
style="fill:#e6e1e8;stroke:#e6e1e8;stroke-width:0.8;stroke-miterlimit:10.0375;fill-opacity:1;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
d="m 48.2641,72.7367 c -79.5094,-93.824467 -39.7547,-46.912233 0,0 z"
id="path791"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
sodipodi:nodetypes="cc" />
<path
d="m -21.0015,104.3185 -0.7774,6.133 1.5508,-2.282 2.3086,1.512 z"
id="path797"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="stroke:none;stroke-opacity:1;fill:none;fill-opacity:1" />
<path
d="m -13.1421,143.5925 0.7773,-6.137 -1.5508,2.281 -2.3047,-1.511 z"
id="path799"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1;stroke:none;stroke-opacity:1" />
<text
class="f7"
x="-66.659271"
y="-56.897106"
id="text15698"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
style="fill:#e6e1e8;fill-opacity:1">Godot</text>
<path
d="m 14.91626,26.9203 v 94.65039"
stroke-dasharray="3, 3"
stroke-width="0.565847"
id="path17110"
style="fill:none;stroke:#e6e1e8;stroke-miterlimit:10.0375;stroke-opacity:1"
inkscape:export-filename="/home/leroy/projects/godot-xterm/docs/wiki/media/pty_diagram.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
</svg>

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,56 @@
---
layout: default
title: Building From Source
parent: Setup
nav_order: 2
permalink: /setup/building-from-source
---
# Building From Source
Building GodotXterm from source consists of four steps:
1. Clone git submodules.
2. Compile libuv using CMake.
3. Compile godot-cpp using scons.
4. Compile libtsm and libgodotxterm using scons.
This plugin follows the same format as the [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html). So if you can compile that example then you are 90% of the way there. The main difference is using CMake to compile libuv.
## Dependencies
- [Git](https://git-scm.com/) (to clone git submodules)
- [SCons](https://scons.org/) (a software construction tool)
- A C/C++ compiler (i.e. [gcc](https://gcc.gnu.org/), [llvm](https://llvm.org/), [MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/))
- [CMake](https://cmake.org/) (to compile libuv)
## The Easy Way
Run the build script in `addons/godot-xterm/native`:
```
cd addons/godot_xterm/native
./build.sh
```
On Windows you can use `git-bash` to run this script.
Provided the dependencies above are installed then it should "just work™".
Binaries for your platform will be installed in `addons/godot_xterm/native/bin`.
The [build.sh] script accepts args `--target` which can be set to `debug` (default) or `release` and `--disable-pty` to compile only the dependencies of [Terminal] node and not [PTY] node (even on platforms that support it).
### The Hard Way
If you are having trouble compiling, study the [build.sh] script and the GitHub actions workflow in [main.yml] to see what commands are being run and how dependencies are installed. You can also dig into the [SConstruct](https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/native/SConstruct) file, and don't forget to refer back to the [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html).
Also feel free to open a new discussion in the [discussions](https://github.com/lihop/godot-xterm/discussions) section of this project.
## Cross Compiling
Although the SConstruct file contains some logic for cross-compiling, it has never been tested. If you want compile for other platforms consider forking this repo and then pushing your changes to GitHub. The workflow defined in [main.yml] will run and build the library for all supported platforms (Linux, macOS, Windows, and HTML5).
Additionally, If you have `docker` and `docker-compose` installed, the [build.sh] script will also try to build the HTML5 binary inside a docker container and copy them to `addons/godot_xterm/native/bin`.
[PTY]: /api/pty
[Terminal]: /api/terminal
[build.sh]: https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/native/build.sh
[main.yml]: https://github.com/lihop/godot-xterm/blob/stable/.github/workflows/main.yml

View file

@ -0,0 +1,54 @@
---
layout: default
title: Precompiled Binaries
parent: Setup
nav_order: 1
permalink: /setup/precompiled-binaries
---
# Precompiled Binaries
{: .no_toc }
Installing GodotXterm using precompiled binaries means that you wont be required
to use a C/C++ compiler to build the project from source. It is simply a matter
of copying files to the correct location in your project. These files can be
installed from several sources:
1. TOC
{:toc}
**Note:** precompiled binaries will only work with certain versions of Godot
(usually the current stable release). If you need binaries for a different or
custom Godot version, or want to make modifications to the C/C++ code, please
refer to the section on [Building From Source](/setup/building-from-source).
## Godot Asset Library
GodotXterm can be installed from the [Godot Asset Library](https://godotengine.org/asset-library/asset/1007).
See the [Godot Asset Library documentation](https://docs.godotengine.org/en/stable/community/asset_library/using_assetlib.html) for more info on how to use it.
## Gd-plug Plugin Manager
If you are using the gd-plug plugin manager you can add the following line to your `plug.gd` file:
```
plug("lihop/godot-xterm-dist", {commit = "a1131a562e8e8f0c57b0ddf61de7fa015d463ba0", include = ["addons/godot_xterm"]})
```
Replace the commit hash with the hash of the GodotXterm version you wish to install.
See [tags](https://github.com/lihop/godot-xterm-dist/tags) for a list of versions and their corresponding commit hashes.
See the [gd-plug documentation](https://github.com/imjp94/gd-plug/blob/master/README.md) for more info on how to use it.
## Manual Installation
Alternatively, GodotXterm can be installed manually in two steps:
1. Copy the [`addons/godot_xterm`](https://github.com/lihop/godot-xterm/tree/stable/addons/godot_xterm) directory to the `addons` directory of your Godot project.
2. Copy the GDNative binaries into `addons/godot_xterm/native/bin` directory.
The easiest way to obtain the GDNative binaries is to download them from [the Releases page](https://github.com/lihop/godot-xterm/releases).
Download the zip archive named `libgodot-xterm-release.zip` and extract its contents into the `/addons/godot_xterm/native/bin` directory of your project.
After this your `addons/godot_xterm/native/bin` directory should contain the following files:
- `libgodot-xterm.javascript.32.wasm`
- `libgodot-xterm.linux.32.so`
- `libgodot-xterm.linux.64.so`
- `libgodot-xterm.osx.64.dylib`
- `libgodot-xterm.windows.32.dll`
- `libgodot-xterm.windows.64.dll`
Debug builds are also available on the Releases page if required.
Download and unzip `libgodot-xterm-debug.zip` instead of `libgodot-xterm-release.zip` to the same location.

9
docs/setup/setup.md Normal file
View file

@ -0,0 +1,9 @@
---
layout: default
title: Setup
nav_order: 2
has_children: true
permalink: /setup
---
# Setup

@ -1 +0,0 @@
Subproject commit 0d47069302d615c09611ee90a0a820986a9b1d00

View file

@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -28,7 +28,7 @@ _global_script_class_icons={
config/name="Godot Xterm"
run/main_scene="res://examples/menu/menu.tscn"
config/icon="res://icon.png"
config/icon="res://docs/media/icon.png"
[display]