feat(pty): add terminal_path property to pty

Property can be set to the NodePath of a Terminal node. Doing so will
conveniently set up the neccessary signals between Terminal and PTY for
them to function together.
This commit is contained in:
Leroy Hopson 2024-04-07 12:25:16 +12:00
parent fa49834347
commit e816396d60
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
3 changed files with 73 additions and 8 deletions

View file

@ -3,6 +3,8 @@
#pragma once
#include "terminal.h"
#include <godot_cpp/classes/mutex.hpp>
#include <godot_cpp/classes/node.hpp>
#include <godot_cpp/classes/os.hpp>
@ -57,6 +59,9 @@ namespace godot
void set_use_threads(bool p_use);
bool is_using_threads() const;
void set_terminal_path(NodePath p_terminal_path);
NodePath get_terminal_path() const;
String get_pts_name() const;
Error fork(const String &file = "", const PackedStringArray &args = PackedStringArray(), const String &cwd = ".", const int cols = 80, const int rows = 24);
@ -83,6 +88,9 @@ namespace godot
String pts_name = "";
NodePath terminal_path;
Terminal *terminal = nullptr;
String _get_fork_file(const String &file) const;
Dictionary _get_fork_env() const;
PackedStringArray _parse_env(const Dictionary &env) const;