Commit graph

10 commits

Author SHA1 Message Date
Leroy Hopson
d00a31fb45
feat(term): implement clear() method
Clears all but the bottommost row of the terminal (including scrollback
buffer) and moves the bottommost row to the top.
2024-03-03 22:39:51 +13:00
Leroy Hopson
71df1e71bd
feat(term): implement copy_all()
Implements the copy_all() method which copies all text in the screen
including text in the scrollback buffer.

Includes a fix to an upstream bug in libtsm that resulted in double the
number of '\n' characters being copied for each row.
2024-03-03 21:04:42 +13:00
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
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
988788fc68
feat(term): implement data_sent signal 2024-02-25 21:14:03 +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
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
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