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).
This commit is contained in:
Leroy Hopson 2024-03-03 19:11:16 +13:00
parent 7f03761fb2
commit 13cf5ba023
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
3 changed files with 45 additions and 4 deletions

View file

@ -71,6 +71,10 @@ namespace godot
void set_blink_off_time(const double p_blink_off_time);
double get_blink_off_time() const;
String copy_selection();
void set_copy_on_selection(const bool p_enable);
bool get_copy_on_selection() const;
void set_inverse_mode(const int mode);
int get_inverse_mode() const;
@ -89,6 +93,8 @@ namespace godot
double blink_on_time;
double blink_off_time;
bool copy_on_selection;
InverseMode inverse_mode;
RenderingServer *rs;