未验证 提交 a642dae0 编写于 作者: B Benjamin Pasero 提交者: GitHub

`process.stdout.write` in Extension Host does nothing (fix #74173) (#83833)

上级 faa9850f
......@@ -20,11 +20,6 @@ if (!!process.send && process.env.PIPE_LOGGING === 'true') {
pipeLoggingToParent();
}
// Disable IO if configured
if (!process.env['VSCODE_ALLOW_IO']) {
disableSTDIO();
}
// Handle Exceptions
if (!process.env['VSCODE_HANDLES_UNCAUGHT_ERRORS']) {
handleExceptions();
......@@ -141,20 +136,6 @@ function pipeLoggingToParent() {
console.error = function () { safeSend({ type: '__$console', severity: 'error', arguments: safeToArray(arguments) }); };
}
function disableSTDIO() {
// const stdout, stderr and stdin be no-op streams. This prevents an issue where we would get an EBADF
// error when we are inside a forked process and this process tries to access those channels.
const stream = require('stream');
const writable = new stream.Writable({
write: function () { /* No OP */ }
});
process['__defineGetter__']('stdout', function () { return writable; });
process['__defineGetter__']('stderr', function () { return writable; });
process['__defineGetter__']('stdin', function () { return writable; });
}
function handleExceptions() {
// Handle uncaught exceptions
......@@ -198,4 +179,4 @@ function configureCrashReporter() {
}
}
//#endregion
\ No newline at end of file
//#endregion
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册