mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-07-01 11:35:31 +02:00
added review suggestions
This commit is contained in:
parent
4ab73fc87f
commit
c7f04f1f9e
3 changed files with 20 additions and 10 deletions
|
@ -27,16 +27,18 @@ sources.append([
|
||||||
|
|
||||||
if env['platform'] == 'linux' or env['platform'] == 'macos':
|
if env['platform'] == 'linux' or env['platform'] == 'macos':
|
||||||
env.Append(LIBS=['util', env.File('thirdparty/libuv/build/libuv_a.a')])
|
env.Append(LIBS=['util', env.File('thirdparty/libuv/build/libuv_a.a')])
|
||||||
else:
|
elif env['platform'] == 'windows':
|
||||||
env.Append(LIBS=['ws2_32.lib', 'Advapi32', 'User32', 'Userenv', 'iphlpapi'])
|
env.Append(LIBS=['ws2_32.lib', 'Advapi32', 'User32', 'Userenv', 'iphlpapi'])
|
||||||
if env["target"] == "template_release":
|
if env["target"] == "template_release":
|
||||||
env.Append(LIBS=[env.File('thirdparty/libuv/build/Release/uv_a.lib')])
|
env.Append(LIBS=[env.File('thirdparty/libuv/build/Release/uv_a.lib')])
|
||||||
else:
|
else:
|
||||||
env.Append(LIBS=[env.File('thirdparty/libuv/build/Debug/uv_a.lib')])
|
env.Append(LIBS=[env.File('thirdparty/libuv/build/Debug/uv_a.lib')])
|
||||||
|
# TODO(ast) this is a bandaid fix (see https://stackoverflow.com/questions/3007312/resolving-lnk4098-defaultlib-msvcrt-conflicts-with)
|
||||||
|
# TODO(ast) a release build needs to use msvcrt instead of msvcrtd
|
||||||
|
env.Append(LINKFLAGS=['/VERBOSE:LIB', '/NODEFAULTLIB:libcmtd.lib', '/NODEFAULTLIB:libcmt.lib', '/NODEFAULTLIB:msvcrt.lib'])
|
||||||
|
else:
|
||||||
|
env.Append(CPPDEFINES=['_PTY_DISABLED'])
|
||||||
|
|
||||||
# TODO(ast) this is a bandaid fix (see https://stackoverflow.com/questions/3007312/resolving-lnk4098-defaultlib-msvcrt-conflicts-with)
|
|
||||||
# TODO(ast) a release build needs to use msvcrt instead of msvcrtd
|
|
||||||
env.Append(LINKFLAGS=['/VERBOSE:LIB', '/NODEFAULTLIB:libcmtd.lib', '/NODEFAULTLIB:libcmt.lib', '/NODEFAULTLIB:msvcrt.lib'])
|
|
||||||
|
|
||||||
if env["platform"] == "macos":
|
if env["platform"] == "macos":
|
||||||
library = env.SharedLibrary(
|
library = env.SharedLibrary(
|
||||||
|
|
|
@ -321,12 +321,20 @@ void PTY::write(const Variant &data) const
|
||||||
|
|
||||||
if (status == STATUS_OPEN)
|
if (status == STATUS_OPEN)
|
||||||
{
|
{
|
||||||
|
#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
|
||||||
uv_buf_t buf;
|
uv_buf_t buf;
|
||||||
buf.base = (char *)bytes.ptr();
|
buf.base = (char *)bytes.ptr();
|
||||||
buf.len = bytes.size();
|
buf.len = bytes.size();
|
||||||
uv_write_t *req = (uv_write_t *)malloc(sizeof(uv_write_t));
|
uv_write_t *req = (uv_write_t *)malloc(sizeof(uv_write_t));
|
||||||
req->data = (void *)buf.base;
|
req->data = (void *)buf.base;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
|
uv_write(req, (uv_stream_t *)&pipe, &buf, 1, _write_cb);
|
||||||
|
#elif defined(_WIN32)
|
||||||
uv_write(req, (uv_stream_t *)&pipe_out, &buf, 1, _write_cb);
|
uv_write(req, (uv_stream_t *)&pipe_out, &buf, 1, _write_cb);
|
||||||
|
#endif
|
||||||
|
|
||||||
uv_run((uv_loop_t *)&loop, UV_RUN_NOWAIT);
|
uv_run((uv_loop_t *)&loop, UV_RUN_NOWAIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,15 +408,15 @@ void PTY::_close()
|
||||||
uv_loop_close(&loop);
|
uv_loop_close(&loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
PTYWin::close(hpc, fd, fd_out);
|
|
||||||
fd_out = -1;
|
|
||||||
hpc = -1;
|
|
||||||
#else
|
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
close(fd);
|
close(fd);
|
||||||
if (pid > 0)
|
if (pid > 0)
|
||||||
kill(IPCSIGNAL_SIGHUP);
|
kill(IPCSIGNAL_SIGHUP);
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
PTYWin::close(hpc, fd, fd_out);
|
||||||
|
fd_out = -1;
|
||||||
|
hpc = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fd = -1;
|
fd = -1;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@tool
|
@tool
|
||||||
extends EditorPlugin
|
extends EditorPlugin
|
||||||
|
|
||||||
var pty_supported := OS.get_name() in ["Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD", "macOS"]
|
var pty_supported := OS.get_name() in ["Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD", "macOS", "Windows"]
|
||||||
var asciicast_import_plugin
|
var asciicast_import_plugin
|
||||||
var xrdb_import_plugin
|
var xrdb_import_plugin
|
||||||
var terminal_panel: Control
|
var terminal_panel: Control
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue