Commit graph

398 commits

Author SHA1 Message Date
Leroy Hopson
fa28b7d6c2
fix(term): remove selection mode enum from tests
The SelectionMode enum is only used internally, so it can be removed
from tests of the public interface.
2024-03-03 21:04:16 +13:00
Leroy Hopson
13cf5ba023
feat(term): implement copy_selection()
Implements the copy_selection() method, which returns the selected text.

Adds a copy_on_selection property. When this property is enabled, the
selected text will automatically be copied to the primary clipboard
(Linux X11/Wayland only).
2024-03-03 21:04:16 +13:00
Leroy Hopson
7f03761fb2
fix(pty): remove non-portable signal enums
Remove signal enum members which do not use portable numbers, and
therefore may be different on different operating systems.
2024-03-03 21:04:16 +13:00
Leroy Hopson
b78bdf3136
feat(pty): rename get_pts() -> get_pts_name() 2024-03-03 21:04:16 +13:00
Leroy Hopson
c6609ebae5
feat(compat): make compatible with godot v4.2+
Previously the plugin could only be used with v4.2.1. This commit
extends support support back to v4.2.0.
2024-03-03 21:04:10 +13:00
Leroy Hopson
1a5f0f96da
chore(test): update tests
Adds additional tests for the interface. Creates a new base test class
GodotXtermTest that adds some additional assert methods. Tests
inheriting from this should override the got_described_class() method.
Add instance of the described class named 'subject' will be created and
added to the scene tree before each test.
2024-03-03 15:41:30 +13:00
Leroy Hopson
cb86cc95d7
fix(pty): use double, not float, for blink times
Changes blink_on_time and blink_off_time to use double rather than
float. When float was used, the default blink_off_time of 0.3 was being
converted to 0.30000001192093 in GDScript.
2024-03-03 15:41:27 +13:00
Leroy Hopson
481a1cb04a
fix(pty): create a loop per pty
Prevents segmentation faults due to several threads trying to run the
same (default) loop.
2024-03-03 00:15:07 +13:00
Leroy Hopson
a0c9777264
feat(pty): add multithread support
Adds the option `use_threads` to PTY (enabled by default) which improves
performance when enabled. For example, running `time cat file.txt` where
file is ~4.5MB will take ~0.250s with threads enabled, versus >20s when
disabled.
2024-03-02 22:49:48 +13:00
Leroy Hopson
46f3aa12bf
chore(ci): enable debug symbols for debug builds
Exclude Windows as it leads to a "warning LNK4099: PDB '' was not found
with 'constants.windows.template_debug.x86_64.obj' or at ''" error on
subsequent runs.
2024-03-02 22:49:42 +13:00
Leroy Hopson
e1000adbe5
feat(pty): call _close() on NOTIFICATION_EXIT_TREE 2024-03-01 22:42:37 +13:00
Leroy Hopson
8fa7df29d3
feat(pty): rename statuses
- NONE -> CLOSED.
- CONNECTED -> OPEN.
- Remove CONNECTING.
2024-03-01 22:35:47 +13:00
Leroy Hopson
80ae0020da
chore(style): change indentation 2024-03-01 22:31:53 +13:00
Leroy Hopson
39b5614f61
feat(pty): use process internal, not _process 2024-03-01 20:28:03 +13:00
Leroy Hopson
91aee43a30
chore(build): enable debug symbols by default 2024-03-01 19:11:47 +13:00
Leroy Hopson
a1be7fb4c3
chore(style): make variable names consistent
Makes the Terminal::_set() variable names consistent with the header
file and the _get() and _get_property_list() methods.
2024-02-27 22:12:29 +13:00
Leroy Hopson
a596b41bc3
feat(term): make 'cols' and 'rows' read-only
Removes the set_cols() and set_rows() method. The read-only properties
are still visible in the editor inspector.
2024-02-27 22:12:07 +13:00
Leroy Hopson
84e1126824
feat(pty): enable resize and resizev 2024-02-25 23:17:45 +13:00
Leroy Hopson
1da42501af
feat(term): add "size_changed" signal
Will be emitted when the number of cols or rows changes.
2024-02-25 22:36:22 +13:00
Leroy Hopson
ee920a45fd
feat(pty): parse env so it can be used with fork
Adds method to convert env from a Dictionary to a PackedStringArray so
it can be used with fork(). Consider making env a PackedStringArray to
begin with.
2024-02-25 22:10:34 +13:00
Leroy Hopson
8cd11fdae6
fix(term): prevent double keyboard input
Disconnects the "gui_input" signal as the _gui_input() override is
working as expected now. Having this signal connected was causing it to
be called twice for every input.
2024-02-25 22:06:58 +13:00
Leroy Hopson
cf0beee0c1
feat(pty): implement "write" method 2024-02-25 21:24:53 +13:00
Leroy Hopson
988788fc68
feat(term): implement data_sent signal 2024-02-25 21:14:03 +13:00
Leroy Hopson
14288352fd
fix(term): address clang warnings 2024-02-25 20:53:09 +13:00
Leroy Hopson
43634affa3
chore(just): update test recipe
Updates the test recipe to use the os_family() function to determine
which test files to include.

Renames 'test_unix.gd' -> 'test_nix.gd'.
2024-02-25 20:51:29 +13:00
Leroy Hopson
05b19c1336
feat(term): implement "key_pressed" signal
Also adds tests for write response as code relating to this was
modified.
2024-02-25 20:25:32 +13:00
Leroy Hopson
c36500615d
feat(pty): further pty development 2024-02-25 17:55:31 +13:00
Leroy Hopson
52a259b019
Run all test types on single runner 2024-02-25 17:21:13 +13:00
Leroy Hopson
f901d18052
Modify matrix 2024-02-25 17:21:09 +13:00
Leroy Hopson
1514f42b54
feat(pty): add initial pty node 2024-02-25 11:48:47 +13:00
Leroy Hopson
d223a458cd
Use matrix.os only for runs-on
Otherwise use matrix.platform.
2024-02-24 19:53:50 +13:00
Leroy Hopson
aa6b447c6c
Wait 5 more frames in rendering test
When using opengl3 rendering driver on macos, we need to wait a few more
frames in order for the test to pass.
2024-02-24 16:58:52 +13:00
Leroy Hopson
6e74b1508b
Merge multiple artifacts 2024-02-24 16:29:57 +13:00
Leroy Hopson
fa238465f8
Don't delay spinning up test runners 2024-02-24 16:20:17 +13:00
Leroy Hopson
b3ea3d4482
Detect rendering driver to use with macos runner 2024-02-24 16:18:50 +13:00
Leroy Hopson
60054e7ee0
Remove asset import job 2024-02-24 15:59:16 +13:00
Leroy Hopson
5c175d9192
Move test-type after platform and arch 2024-02-24 15:45:06 +13:00
Leroy Hopson
0bc4d8b5a2
Enable tests for macos 2024-02-24 12:04:21 +13:00
Leroy Hopson
22e0b4e484
Update remaining upload/download artifact actions 2024-02-24 10:11:51 +13:00
Leroy Hopson
11e42a820a
Partially update upload/download artifact action 2024-02-24 00:06:10 +13:00
Leroy Hopson
b9d9a4b1af
Merge branch 'master' into godot4 2024-02-23 21:54:51 +13:00
Leroy Hopson
e336829407
Update upload-artifact action 2024-02-23 21:25:37 +13:00
Leroy Hopson
4771a3c9a7
Fix rendering according to test 2024-02-18 20:31:08 +13:00
Leroy Hopson
6d112ca0f2
Add method get_cell_size() 2024-02-18 20:24:31 +13:00
Leroy Hopson
685884965e
Fix bell behaviour according to tests 2024-02-18 20:24:27 +13:00
Leroy Hopson
dc97c56b17
Use type Vector2i for get_cursor_pos()
Cursor position is always integer.
2024-02-18 14:06:30 +13:00
Leroy Hopson
0ccc539f36
Prevent creation of orphan Timer 2024-02-18 14:06:30 +13:00
Leroy Hopson
2b5ea392bf
Free fore_canvas_item
Frees fore_canvas_item in cleanup, preventing RID allocation leak.
2024-02-18 14:06:30 +13:00
Leroy Hopson
db3564f0cc
Setup tests
- Install Gut using gd-plug.
- Add some basic tests.
- Update workflow to run tests.
- Add test and gd-plug install/uninstall recipes to Justfile.
- Re-enable debug builds as these are used by editor when testing.
2024-02-18 14:06:25 +13:00
Leroy Hopson
e234b14867
Only register/remove Terminal once 2024-02-18 12:50:21 +13:00