diff --git a/addons/godot_xterm/native/src/pty.cpp b/addons/godot_xterm/native/src/pty.cpp index da5b405..6b0913f 100644 --- a/addons/godot_xterm/native/src/pty.cpp +++ b/addons/godot_xterm/native/src/pty.cpp @@ -55,6 +55,8 @@ void PTY::_bind_methods() { 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)); ClassDB::bind_method(D_METHOD("write", "data"), &PTY::write); + ClassDB::bind_method(D_METHOD("resize", "cols", "rows"), &PTY::resize); + ClassDB::bind_method(D_METHOD("resizev", "size"), &PTY::resizev); ClassDB::bind_method(D_METHOD("kill", "signal"), &PTY::kill); ClassDB::bind_method(D_METHOD("_on_exit", "exit_code", "signal_code"), &PTY::_on_exit); @@ -156,6 +158,9 @@ Error PTY::open(const int cols, const int rows) { } void PTY::resize(const int cols, const int rows) const { + #if defined(__linux__) || defined(__APPLE__) + PTYUnix::resize(fd, cols, rows); + #endif } void PTY::write(const Variant &data) const { diff --git a/addons/godot_xterm/native/src/pty_unix.cpp b/addons/godot_xterm/native/src/pty_unix.cpp index 8a1c43f..f06c04d 100644 --- a/addons/godot_xterm/native/src/pty_unix.cpp +++ b/addons/godot_xterm/native/src/pty_unix.cpp @@ -467,7 +467,7 @@ Dictionary PTYUnix::open( return result; } -void resize( +void PTYUnix::resize( const int &p_fd, const int &p_cols, const int &p_rows diff --git a/addons/godot_xterm/native/src/pty_unix.h b/addons/godot_xterm/native/src/pty_unix.h index 7ff7fd5..ffc75c0 100644 --- a/addons/godot_xterm/native/src/pty_unix.h +++ b/addons/godot_xterm/native/src/pty_unix.h @@ -29,5 +29,11 @@ namespace godot const int &p_cols, const int &p_rows ); + + static void resize( + const int &p_fd, + const int &p_cols, + const int &p_rows + ); }; } // namespace godot