Bring ptyService into shared proc
Hopefully to get tests passing
This commit is contained in:
parent
4e1b20a7d5
commit
dc4fa4878f
|
@ -70,7 +70,7 @@
|
|||
"native-is-elevated": "0.4.1",
|
||||
"native-keymap": "2.2.1",
|
||||
"native-watchdog": "1.3.0",
|
||||
"node-pty": "0.11.0-beta1",
|
||||
"node-pty": "0.10.0-beta19",
|
||||
"spdlog": "^0.11.1",
|
||||
"sudo-prompt": "9.1.1",
|
||||
"tas-client-umd": "0.1.2",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"jschardet": "2.2.1",
|
||||
"minimist": "^1.2.5",
|
||||
"native-watchdog": "1.3.0",
|
||||
"node-pty": "0.11.0-beta1",
|
||||
"node-pty": "0.10.0-beta19",
|
||||
"spdlog": "^0.11.1",
|
||||
"tas-client-umd": "0.1.2",
|
||||
"vscode-nsfw": "1.2.9",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"dependencies": {
|
||||
"iconv-lite-umd": "0.6.8",
|
||||
"jschardet": "2.2.1",
|
||||
"node-pty": "0.11.0-beta1",
|
||||
"node-pty": "0.10.0-beta19",
|
||||
"tas-client-umd": "0.1.2",
|
||||
"vscode-oniguruma": "1.3.1",
|
||||
"vscode-textmate": "5.2.0",
|
||||
|
|
|
@ -17,10 +17,10 @@ nan@^2.14.0:
|
|||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
|
||||
integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==
|
||||
|
||||
node-pty@0.11.0-beta1:
|
||||
version "0.11.0-beta1"
|
||||
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta1.tgz#961cf7ab56e0a689b71a19a46371ea090050f312"
|
||||
integrity sha512-nHMB0K3LZTqjWv3X11XFdy/L4V2eMEk0RbmbVN02GPOkXdMy2NITI0px/x0JtNeIolRPq6r5hf5NUcNc2LJizw==
|
||||
node-pty@0.10.0-beta19:
|
||||
version "0.10.0-beta19"
|
||||
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.10.0-beta19.tgz#b7cbfba53f7b2a816efe8c9302dd083cc5874458"
|
||||
integrity sha512-4UIOGMvpofUbe+ZniBUtY8zc/psMURSzbMonQgIhK7JlMQsUwcbkDIrKzStVLJX0FkeZpUNlsVtK7qqzHvrUZA==
|
||||
dependencies:
|
||||
nan "^2.14.0"
|
||||
|
||||
|
|
|
@ -304,10 +304,10 @@ node-addon-api@^3.0.2:
|
|||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.2.tgz#04bc7b83fd845ba785bb6eae25bc857e1ef75681"
|
||||
integrity sha512-+D4s2HCnxPd5PjjI0STKwncjXTUKKqm74MDMz9OPXavjsGmjkvwgLtA5yoxJUdmpj52+2u+RrXgPipahKczMKg==
|
||||
|
||||
node-pty@0.11.0-beta1:
|
||||
version "0.11.0-beta1"
|
||||
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta1.tgz#961cf7ab56e0a689b71a19a46371ea090050f312"
|
||||
integrity sha512-nHMB0K3LZTqjWv3X11XFdy/L4V2eMEk0RbmbVN02GPOkXdMy2NITI0px/x0JtNeIolRPq6r5hf5NUcNc2LJizw==
|
||||
node-pty@0.10.0-beta19:
|
||||
version "0.10.0-beta19"
|
||||
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.10.0-beta19.tgz#b7cbfba53f7b2a816efe8c9302dd083cc5874458"
|
||||
integrity sha512-4UIOGMvpofUbe+ZniBUtY8zc/psMURSzbMonQgIhK7JlMQsUwcbkDIrKzStVLJX0FkeZpUNlsVtK7qqzHvrUZA==
|
||||
dependencies:
|
||||
nan "^2.14.0"
|
||||
|
||||
|
|
|
@ -55,15 +55,9 @@ else
|
|||
fi
|
||||
|
||||
if [ -z "$INTEGRATION_TEST_APP_NAME" ]; then
|
||||
after_suite() {
|
||||
true;
|
||||
ps -aef --forest;
|
||||
}
|
||||
after_suite() { true; }
|
||||
else
|
||||
after_suite() {
|
||||
killall $INTEGRATION_TEST_APP_NAME || true;
|
||||
ps -aef --forest;
|
||||
}
|
||||
after_suite() { killall $INTEGRATION_TEST_APP_NAME || true; }
|
||||
fi
|
||||
|
||||
# Integration tests in AMD
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IPtyService, IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
||||
import { Client } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IPtyService, IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError } from 'vs/platform/terminal/common/terminal';
|
||||
// import { Client } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||
// import { FileAccess } from 'vs/base/common/network';
|
||||
// import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { LogLevelChannelClient } from 'vs/platform/log/common/logIpc';
|
||||
// import { LogLevelChannelClient } from 'vs/platform/log/common/logIpc';
|
||||
import { PtyService } from 'vs/platform/terminal/node/ptyService';
|
||||
|
||||
// enum Constants {
|
||||
// MaxRestarts = 5
|
||||
|
@ -53,50 +54,51 @@ export class LocalPtyService extends Disposable implements IPtyService {
|
|||
}
|
||||
|
||||
private _startPtyHost(): IPtyService {
|
||||
const client = this._register(new Client(
|
||||
FileAccess.asFileUri('bootstrap-fork', require).fsPath,
|
||||
{
|
||||
serverName: 'Pty Host',
|
||||
args: ['--type=ptyHost'],
|
||||
env: {
|
||||
VSCODE_AMD_ENTRYPOINT: 'vs/platform/terminal/node/ptyHostMain',
|
||||
VSCODE_PIPE_LOGGING: 'true',
|
||||
VSCODE_VERBOSE_LOGGING: 'true' // transmit console logs from server to client
|
||||
}
|
||||
}
|
||||
));
|
||||
this._onPtyHostStart.fire();
|
||||
// const client = this._register(new Client(
|
||||
// FileAccess.asFileUri('bootstrap-fork', require).fsPath,
|
||||
// {
|
||||
// serverName: 'Pty Host',
|
||||
// args: ['--type=ptyHost'],
|
||||
// env: {
|
||||
// VSCODE_AMD_ENTRYPOINT: 'vs/platform/terminal/node/ptyHostMain',
|
||||
// VSCODE_PIPE_LOGGING: 'true',
|
||||
// VSCODE_VERBOSE_LOGGING: 'true' // transmit console logs from server to client
|
||||
// }
|
||||
// }
|
||||
// ));
|
||||
// this._onPtyHostStart.fire();
|
||||
|
||||
// Handle exit
|
||||
this._register({
|
||||
dispose: () => {
|
||||
if (proxy.shutdownAll) {
|
||||
proxy.shutdownAll();
|
||||
}
|
||||
client.dispose();
|
||||
}
|
||||
});
|
||||
this._register(client.onDidProcessExit(e => {
|
||||
this._onPtyHostExit.fire(e.code);
|
||||
// if (!this._isDisposed) {
|
||||
// if (this._restartCount <= Constants.MaxRestarts) {
|
||||
// this._logService.error(`ptyHost terminated unexpectedly with code ${e.code}`);
|
||||
// this._restartCount++;
|
||||
// this._proxy = this._startPtyHost();
|
||||
// } else {
|
||||
// this._logService.error(`ptyHost terminated unexpectedly with code ${e.code}, giving up`);
|
||||
// }
|
||||
// }
|
||||
}));
|
||||
// // Handle exit
|
||||
// this._register({
|
||||
// dispose: () => {
|
||||
// if (proxy.shutdownAll) {
|
||||
// proxy.shutdownAll();
|
||||
// }
|
||||
// client.dispose();
|
||||
// }
|
||||
// });
|
||||
// this._register(client.onDidProcessExit(e => {
|
||||
// this._onPtyHostExit.fire(e.code);
|
||||
// // if (!this._isDisposed) {
|
||||
// // if (this._restartCount <= Constants.MaxRestarts) {
|
||||
// // this._logService.error(`ptyHost terminated unexpectedly with code ${e.code}`);
|
||||
// // this._restartCount++;
|
||||
// // this._proxy = this._startPtyHost();
|
||||
// // } else {
|
||||
// // this._logService.error(`ptyHost terminated unexpectedly with code ${e.code}, giving up`);
|
||||
// // }
|
||||
// // }
|
||||
// }));
|
||||
|
||||
// Setup logging
|
||||
const logChannel = client.getChannel(TerminalIpcChannels.Log);
|
||||
this._register(this._logService.onDidChangeLogLevel(() => {
|
||||
LogLevelChannelClient.setLevel(logChannel, this._logService.getLevel());
|
||||
}));
|
||||
// const logChannel = client.getChannel(TerminalIpcChannels.Log);
|
||||
// this._register(this._logService.onDidChangeLogLevel(() => {
|
||||
// LogLevelChannelClient.setLevel(logChannel, this._logService.getLevel());
|
||||
// }));
|
||||
|
||||
// Create proxy and forward events
|
||||
const proxy = ProxyChannel.toService<IPtyService>(client.getChannel(TerminalIpcChannels.PtyHost));
|
||||
const proxy = new PtyService(this._logService);
|
||||
// const proxy = ProxyChannel.toService<IPtyService>(client.getChannel(TerminalIpcChannels.PtyHost));
|
||||
this._register(proxy.onProcessData(e => this._onProcessData.fire(e)));
|
||||
this._register(proxy.onProcessExit(e => this._onProcessExit.fire(e)));
|
||||
this._register(proxy.onProcessReady(e => this._onProcessReady.fire(e)));
|
||||
|
|
|
@ -6672,10 +6672,10 @@ node-libs-browser@^2.2.1:
|
|||
util "^0.11.0"
|
||||
vm-browserify "^1.0.1"
|
||||
|
||||
node-pty@0.11.0-beta1:
|
||||
version "0.11.0-beta1"
|
||||
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta1.tgz#961cf7ab56e0a689b71a19a46371ea090050f312"
|
||||
integrity sha512-nHMB0K3LZTqjWv3X11XFdy/L4V2eMEk0RbmbVN02GPOkXdMy2NITI0px/x0JtNeIolRPq6r5hf5NUcNc2LJizw==
|
||||
node-pty@0.10.0-beta19:
|
||||
version "0.10.0-beta19"
|
||||
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.10.0-beta19.tgz#b7cbfba53f7b2a816efe8c9302dd083cc5874458"
|
||||
integrity sha512-4UIOGMvpofUbe+ZniBUtY8zc/psMURSzbMonQgIhK7JlMQsUwcbkDIrKzStVLJX0FkeZpUNlsVtK7qqzHvrUZA==
|
||||
dependencies:
|
||||
nan "^2.14.0"
|
||||
|
||||
|
|
Loading…
Reference in a new issue