I believe I have found a solution below. however I was wondering if this workaround is the easiest.
stdout_print = Function({msg},
{_tty},
Run Program(
Executable("/bin/sh"),
Options({"-c", "ps -o tty= -p $(ps -o ppid= -p $(ps -o ppid= -p $$)) | tr -d ' ' > /tmp/jmp_tty.txt"})
);
Wait(1);
_tty = "/dev/" || Trim(Load Text File("/tmp/jmp_tty.txt"));
Run Program(
Executable("/bin/sh"),
Options({"-c", "echo '" || msg || "' > " || _tty})
);
);
stdout_print("hello");