Commit graph

246 commits

Author SHA1 Message Date
Leroy Hopson
fae6317eb7
Use default export templates for HTML5
Changes Emscripten SDK version to match that used to compile the default export
templates used by Godot 3.5 (in this case 3.1.14 as can be seen here:
https://github.com/godotengine/build-containers/blob/3.5/Dockerfile.javascript).

This means we no longer need to compile custom export templates when
exporting HTML5 for Godot 3.5. Exports from other Godot versions may
requiring compiling the GDNative library with a different version of the
Emscripten SDK.

- Changes renderer from GLES3 -> GLES2 and reduces MSAA level to better
  support HTML5 export.
- Updates GitHub Action to export HTML5 and upload as a build artifact.
- Adds Cypress test to smoke test HTML5 export.
2024-03-29 19:36:44 +13:00
Leroy Hopson
b31861f171
Double max test attempts 2024-03-29 19:35:23 +13:00
Leroy Hopson
2b3d4533c4
Change exit action for HTML5
Previously HTML5 exports would reload the page on exit. This commit
changes the behaviour to go back to the previous page (if any) or close
the tab and/or window if there is no previous page.
2024-03-29 19:35:14 +13:00
Leroy Hopson
f8ab8ddd61
Update GDScript Toolkit 2024-03-29 19:34:01 +13:00
Leroy Hopson
f4db2d9c2e
Change target Godot version to v3.5-stable
Upgrade setup-godot action from v1 -> v2 which changes default Godot
version from 3.4 -> 3.5.
2024-03-29 19:19:08 +13:00
Leroy Hopson
7e65be4cf9
Fix typo in deprecated color name 2022-08-26 12:23:39 +12:00
Leroy Hopson
4f24f2bd37
Bump version to 2.2.0 2022-08-26 10:02:09 +12:00
Leroy Hopson
524c0e51c6
Update CHANGELOG 2022-08-26 10:01:30 +12:00
Leroy Hopson
95b66115c4
Update/deprecate theme item names
Updates theme names to be compatible with Godot 3.5 (no spaces),
consistent with other Godot theme item names (snake_case), and
match the color names listed on the
[ANSI escape code wikipedia page](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit).

Deprecates the old names and warns users to change them.
2022-08-26 09:28:38 +12:00
Leroy Hopson
aee3efd8de
Update 3.4.x target version to 3.4.5 2022-08-25 12:37:41 +12:00
Leroy Hopson
b22343a05f
Retry tests
Tests sometimes fail on Ubuntu due to a race condition with the pulse
audio process and on macOS due to timing issues. These tests usually
pass on subsequent runs, so use the retry action to retry them in a
single run.
2022-08-24 09:54:14 +12:00
Leroy Hopson
1485a502ab
Use non-pinned version of setup-godot
Using the major version of the setup-godot action without specifying
minor and patch versions will allow us to start using the newest minor
and patch releases as soon as they are made available on the GitHub
marketplace.
2022-08-24 09:54:14 +12:00
Leroy Hopson
0fcc95c825
Remove space in project name: Godot Xterm -> GodotXterm 2022-08-23 14:49:36 +12:00
Leroy Hopson
6a6adb7294
Update CHANGELOG 2022-08-23 14:45:02 +12:00
Leroy Hopson
d45ea7a3cd
Update libtsm to not erase screen on palette change
Fixes #57.
Fixes #58.
2022-08-22 22:56:50 +12:00
Leroy Hopson
07f76f2956
Don't clone submodules for non build jobs
Submodules are only required for building the GDNative library or export
templates, otherwise we download the pre-built ones so don't need the
submodules.
2022-08-22 22:56:08 +12:00
Leroy Hopson
1110219cf7
Only restore submodules on exact match
Only restore git submodules if we have an exact match, otherwise we will
restore outdated submodules over newer ones, then save the outdated
version with the exact match after.
2022-08-22 22:56:02 +12:00
Leroy Hopson
344c04f9d8
Move terminal bell tests from unit -> integration
The bell tests rely on timers and yields, so are too slow to run as part
of the unit test suite.
2022-08-22 10:05:41 +12:00
Leroy Hopson
41525959e1
Deprecate undocumented get_master() method
This method was never officially documented and used only as a workaround for
issue #53. It also returns an instance of the undocumented and scruffily
implemented Pipe class that I would prefer to keep internal.

Now that #53 has been fixed, this method can be removed from the unofficial
public API, but deprecate it just in case. If someone was using it then it
is still possible (although not supported) to access the `_pipe` property of
`_pty_native`.
2022-08-22 10:05:41 +12:00
Leroy Hopson
6cd5facb98
Deprecate the cols and rows properties of Terminal
As cols and rows are read only (i.e. automatically determined by rect
and font size) there is no need for the properties to be exposed.
Instead, users can get the calculated cols and rows using the get_cols()
and get_rows() methods.
2022-08-22 10:05:36 +12:00
Leroy Hopson
f49410838c
Drop support for Godot 3.3.x 2022-08-22 10:02:50 +12:00
Leroy Hopson
c6e99ff5c2
Show plugin version on HTML5 demo
Shows the plugin version in addons/godot_xterm/plugin.cfg on the main
screen of the HTML5 demo.
2022-08-19 12:55:04 +12:00
Leroy Hopson
c02b869e2c
Update demo URL 2022-08-19 11:56:08 +12:00
Leroy Hopson
6e9cd130a7
Bump version to 2.1.1 2022-08-15 17:12:36 +12:00
Leroy Hopson
d1153dcaa4
Update CHANGELOG 2022-08-15 17:09:29 +12:00
Leroy Hopson
9ed6750b83
Fix unicode errors
Changes `write()` method of native pipe and terminal to accept a
PoolByteArray rather than String. This means that `get_string_from_utf8()`
is no longer called on data coming from PTY and being sent to Terminal.

The terminal state machine already has a UTF8 parser which maintains
its state across calls to `write()`. This means that we can write half
the bytes of a single unicode character in one call and the remaining half
in the next call and the state machine will parse it correctly.

On the other hand, the `get_string_from_utf8()` method of Godot's
PoolByteArray requires that the array contains completely valid UTF8,
otherwise we get errors such as "Unicode error: invalid skip".

The data coming from PTY can be arbitrarily split in the middle of a
unicode character meaning that we will sometimes get errors when calling
`get_string_from_utf8()` on it. This is more likely to occur when there
is a large amount of output (i.e. it's more likely to be split). In other
cases, the data might intentionally contain invalid unicode such as when
printing binary files or random data (e.g. `cat /bin/sh`, `cat /dev/random`).

We avoid these errors by passing the PoolByteArray data directly to the terminal
state machine.

In addition to fixing unicode errors, this commit:
- Prevents repeated calls to pipes `_read_cb()` method that would block Godot
  and result in a crash with the message "ERROR: All memory pool allocations
  are in use" that resulted from writing data to an ever-increasing number of
  PoolByteArrays before any of them could be freed. This could be triggered by
  running the `cat /dev/urandom` command after making the change to `write()`
  mentioned above.
- Prevents memory leaks by freeing libuv buffers after they have been copied
  to PoolByteArrays.

Fixes #55.
2022-08-15 17:09:29 +12:00
Leroy Hopson
054c7c9ad4
Ensure initial PTY size matches Terminal (if any)
If a PTY has a terminal_path set to a valid Terminal, then ensure that
the initial cols and rows of PTY match the cols and rows of the Terminal
when calling fork() or open(), otherwise PTY will output wrong-sized
data for the Terminal until resized.

Fixes #56.
2022-08-15 17:09:25 +12:00
Leroy Hopson
00a34a9177
Add missing links to terminal docs 2022-08-15 10:08:55 +12:00
Leroy Hopson
c3b2e1d5fa
Add VSCode debug launch configuration for main scene 2022-08-14 21:13:24 +12:00
Leroy Hopson
d27b0c57ce
Remove typo in docs 2022-08-14 21:13:18 +12:00
Leroy Hopson
d967fe6327
Fix relative links to PTY and Terminal diagrams 2022-08-10 23:51:40 +12:00
Leroy Hopson
6f89edc14e
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.
2022-08-10 23:13:05 +12:00
Leroy Hopson
66254ea17e
Update setup-godot action: 1.0.1 -> 1.0.2 2022-08-10 22:56:46 +12:00
Leroy Hopson
041e7a445f Request redraw after write if terminal visible
Requests a redraw after writing to terminal if it is visible, otherwise
terminal will not be updated if there are no other redraw requests.

Fixes #53.
2022-08-08 10:13:53 +12:00
Leroy Hopson
9896a362c3
Automatic editor updates
Automatic updates applied to scenes after opening in Godot editor
v3.4.4-stable.
2022-08-06 20:32:58 +12:00
Leroy Hopson
2acb93f8ff
Update CHANGELOG 2022-08-05 11:26:22 +12:00
Leroy Hopson
d558b07fd4 Prevent loss of focus on Tab/Arrow key press
Prevents Terminal losing focus when in a scene with other inputs and
the Tab or Arrow keys are pressed.

Fixes #51.
2022-08-05 10:55:24 +12:00
Leroy Hopson
8a3adbbe68
Fix GitHub Actions godot-cpp-linux Docker build 2022-08-03 22:41:12 +12:00
Leroy Hopson
03583c0a1b
Update setup-godot action 2022-07-13 09:03:18 +12:00
Leroy Hopson
d99a750d33
Stop testing for Godot version 3.2 2022-07-12 12:51:24 +12:00
Leroy Hopson
e558162d38
Update docs 2022-07-11 13:19:44 +12:00
Leroy Hopson
3b7bdfc5ca
Bump version to 2.1.0 2022-07-11 09:33:01 +12:00
Leroy Hopson
df32ee3c18
Refactor PTY
PTY now provides a public interface to an underlying instance of
PTYNative. The PTYNative class can be extended as appropriate for
each platform and the platform-specific implementation will be
selected by PTY at runtime.
2022-07-11 09:33:01 +12:00
Leroy Hopson
d11853e9f6
Update GDScript Toolkit 2022-07-11 09:33:01 +12:00
Leroy Hopson
b76f8d0939
Prevent scrollback buffer reset when using copy shortcut
Prevents scrollback buffer reset (i.e. scrolling to the bottom of
terminal output) when pressing modifier keys in isolation or when
copying text using the shortcut Ctrl+Shift+C.
2022-07-11 09:33:01 +12:00
Leroy Hopson
cf613708c4
Fix resume after yield error
Fixes error that would sometimes occur when closing the Terminal after
calling write() but before the VisualServer had finished drawing the
current frame.
2022-07-11 09:33:01 +12:00
Leroy Hopson
0ae1d80abb
Prevent exit callback instance leaks
De-references pty_baton's exit callback after it is called so it can be
automatically released, preventing leaked instances.

Adds basic implementation for Pipe's get_status() method and forces PTY
to wait for child process to exit to ensure exit callback is cleaned up.

Adds a test to check that exit callback is still called as usual.
2022-07-11 09:33:01 +12:00
Leroy Hopson
38927e0a3e
Fix winsize test to support unsigned short
The type of winsize.ws_col and winsize.ws_row is unsigned short, so
change python's struct.unpack format from 'hh' (short) to 'HH'.
Otherwise, we can only test sizes up to 32767 when actually sizes up to
65535 are supported.
2022-07-11 09:33:01 +12:00
Leroy Hopson
ed05f79073
Add VSCode launch configuration for debugging tests 2022-07-11 09:33:01 +12:00
Leroy Hopson
95c8974ebf
Add job to check GDScript format 2022-07-11 09:33:01 +12:00