mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 01:30:25 +01:00
feat(pty): enable resize and resizev
This commit is contained in:
parent
1da42501af
commit
84e1126824
3 changed files with 12 additions and 1 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue