mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-04 12:14:24 +02:00
Change terminal menu option 'Select All' -> 'Copy All'
Adds copy_all() function to terminal node which returns all of the screen's text.
This commit is contained in:
parent
703eb68f11
commit
97e07093b2
4 changed files with 14 additions and 2 deletions
|
@ -295,6 +295,7 @@ void Terminal::_register_methods() {
|
|||
register_method("select_to_pointer", &Terminal::select_to_pointer);
|
||||
register_method("reset_selection", &Terminal::reset_selection);
|
||||
register_method("copy_selection", &Terminal::copy_selection);
|
||||
register_method("copy_all", &Terminal::copy_all);
|
||||
|
||||
register_method("_update_theme", &Terminal::update_theme);
|
||||
register_method("_update_size", &Terminal::update_theme);
|
||||
|
@ -626,3 +627,11 @@ String Terminal::copy_selection() {
|
|||
std::free(out);
|
||||
return result;
|
||||
}
|
||||
|
||||
String Terminal::copy_all() {
|
||||
char *out = nullptr;
|
||||
int len = tsm_screen_copy_all(screen, &out);
|
||||
String result = String(out);
|
||||
std::free(out);
|
||||
return result;
|
||||
}
|
|
@ -64,6 +64,7 @@ public:
|
|||
void select_to_pointer(Vector2 position);
|
||||
void reset_selection();
|
||||
String copy_selection();
|
||||
String copy_all();
|
||||
|
||||
enum UpdateMode {
|
||||
DISABLED,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue