Refactor PTY

PTY now provides a public interface to an underlying instance of
PTYNative. The PTYNative class can be extended as appropriate for
each platform and the platform-specific implementation will be
selected by PTY at runtime.
This commit is contained in:
Leroy Hopson 2022-06-29 22:58:48 +07:00
parent d11853e9f6
commit df32ee3c18
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
8 changed files with 539 additions and 333 deletions

View file

@ -0,0 +1,28 @@
tool
extends Node
signal data_received(data)
signal exited(exit_code, signum)
func open(cols: int, rows: int):
return _not_implemented()
func resize(cols: int, rows: int):
return _not_implemented()
func get_master():
return _not_implemented()
func _not_implemented() -> int:
var method := ""
var stack = get_stack()
if stack.size() >= 2 and "function" in stack[1]:
method = "%s()" % stack[1].function
push_error("Method %s not implemented on the current platform (%s)." % [method, OS.get_name()])
return ERR_METHOD_NOT_FOUND