mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-13 15:05:30 +02:00
Add new PTY node (replaces Pseudoterminal node)
Uses fork of node-pty native code for forking pseudoterminals. Uses libuv pipe handle to communicate with the child process. - Paves the way for cross-platform (Linux, macOS and Windows) support. - Renames Pseudoterminal to PTY (which is much easier to type and spell :D). - Better performance than the old Pseudoterminal node. Especially when streaming large amounts of data such as running the `yes` command. - Allows setting custom file, args, initial window size, cwd, env vars (including important ones such as TERM and COLORTERM) and uid/gid on Linux and macOS. - Returns process exit code and terminating signal.
This commit is contained in:
parent
bfa561357e
commit
0dd2378387
36 changed files with 1268 additions and 442 deletions
30
test/integration/uv_utils/uv_utils.test.gd
Normal file
30
test/integration/uv_utils/uv_utils.test.gd
Normal file
|
@ -0,0 +1,30 @@
|
|||
extends "res://addons/gut/test.gd"
|
||||
|
||||
const LibuvUtils := preload("res://addons/godot_xterm/nodes/pty/libuv_utils.gd")
|
||||
|
||||
|
||||
class TestGetOSEnviron:
|
||||
extends "res://addons/gut/test.gd"
|
||||
|
||||
const EMPTY_VAR = "GODOT_XTERM_TEST_EMPTY_ENV_VAR"
|
||||
const TEST_VAR = "GODOT_XTERM_TEST_ENV_VAR"
|
||||
const TEST_VAL = "TEST123"
|
||||
|
||||
var env: Dictionary
|
||||
|
||||
func before_each():
|
||||
assert(OS.set_environment(EMPTY_VAR, ""))
|
||||
assert(OS.set_environment(TEST_VAR, TEST_VAL))
|
||||
env = LibuvUtils.get_os_environ()
|
||||
|
||||
func test_has_empty_var():
|
||||
assert_has(env, EMPTY_VAR)
|
||||
|
||||
func test_empty_var_has_empty_val():
|
||||
assert_eq(env[EMPTY_VAR], "")
|
||||
|
||||
func test_has_test_var():
|
||||
assert_has(env, TEST_VAR)
|
||||
|
||||
func test_test_var_has_correct_val():
|
||||
assert_eq(env[TEST_VAR], TEST_VAL)
|
Loading…
Add table
Add a link
Reference in a new issue