diff --git a/addons/godot_xterm/native/src/pty.cpp b/addons/godot_xterm/native/src/pty.cpp index e0a725c..c366338 100644 --- a/addons/godot_xterm/native/src/pty.cpp +++ b/addons/godot_xterm/native/src/pty.cpp @@ -62,7 +62,7 @@ void PTY::_bind_methods() { ClassDB::bind_method(D_METHOD("is_using_threads"), &PTY::is_using_threads); ClassDB::add_property("PTY", PropertyInfo(Variant::BOOL, "use_threads"), "set_use_threads", "is_using_threads"); - ClassDB::bind_method(D_METHOD("get_pts"), &PTY::get_pts); + ClassDB::bind_method(D_METHOD("get_pts_name"), &PTY::get_pts_name); ClassDB::bind_method(D_METHOD("fork", "file", "args", "cwd", "cols", "rows"), &PTY::fork, DEFVAL(""), DEFVAL(PackedStringArray()), DEFVAL("."), DEFVAL(80), DEFVAL(24)); ClassDB::bind_method(D_METHOD("open", "cols", "rows"), &PTY::open, DEFVAL(80), DEFVAL(24)); @@ -126,8 +126,8 @@ bool PTY::is_using_threads() const { return use_threads; } -String PTY::get_pts() const { - return pts; +String PTY::get_pts_name() const { + return pts_name; } Error PTY::fork(const String &file, const PackedStringArray &args, const String &cwd, const int cols, const int rows) { @@ -145,8 +145,8 @@ Error PTY::fork(const String &file, const PackedStringArray &args, const String fd = result["fd"]; pid = result["pid"]; - pts = result["pty"]; - + pts_name = result["pty"]; + status = STATUS_OPEN; #if defined(__linux__) || defined(__APPLE__) @@ -181,7 +181,7 @@ Error PTY::open(const int cols, const int rows) { Error err = static_cast((int)result["error"]); ERR_FAIL_COND_V(err != OK, err); - pts = result["pty"]; + pts_name = result["pty"]; return OK; } diff --git a/addons/godot_xterm/native/src/pty.h b/addons/godot_xterm/native/src/pty.h index 86d0376..4c9e2a6 100644 --- a/addons/godot_xterm/native/src/pty.h +++ b/addons/godot_xterm/native/src/pty.h @@ -58,7 +58,7 @@ namespace godot void set_use_threads(bool p_use); bool is_using_threads() const; - String get_pts() 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); void kill(const int signum = Signal::SIGNAL_SIGHUP); @@ -82,7 +82,7 @@ namespace godot Dictionary env = Dictionary(); bool use_os_env = true; - String pts = ""; + String pts_name = ""; String _get_fork_file(const String &file) const; Dictionary _get_fork_env() const; diff --git a/test/test_nix.gd b/test/test_nix.gd index 09cdb24..ab285c3 100644 --- a/test/test_nix.gd +++ b/test/test_nix.gd @@ -43,7 +43,7 @@ func test_open_pty_has_correct_name(): var new_pts = helper.get_pts() for pt in original_pts: new_pts.erase(pt) - assert_eq(subject.get_pts(), new_pts[0]) + assert_eq(subject.get_pts_name(), new_pts[0]) func xtest_open_pty_has_correct_win_size(): diff --git a/test/test_pty.gd b/test/test_pty.gd index 7989b99..d08762b 100644 --- a/test/test_pty.gd +++ b/test/test_pty.gd @@ -11,8 +11,6 @@ func get_described_class(): class TestInterface: extends PTYTest - ## API V2. - # Properties. # TODO: Implement cols property. @@ -46,6 +44,9 @@ class TestInterface: func test_has_method_open(): assert_has_method_with_return_type("open", TYPE_INT) + func test_has_method_get_pts_name(): + assert_has_method_with_return_type("get_pts_name", TYPE_STRING) + func test_has_method_resize(): assert_has_method_with_return_type("resize", TYPE_NIL)