Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3021226
Move remoteterminalservice reg to contribution
Tyriar Feb 8, 2021
ee4a8bd
Create pty service main <-> renderer channel
Tyriar Feb 8, 2021
281d228
Rename pty service to local pty service
Tyriar Feb 8, 2021
456841a
Create createProcess ipc interface
Tyriar Feb 8, 2021
1e298d0
Pass executableEnv to other side
Tyriar Feb 8, 2021
6132a76
Get one way communication happening
Tyriar Feb 9, 2021
47adc86
Get 2 way communication working
Tyriar Feb 9, 2021
4b5108a
Remove log
Tyriar Feb 9, 2021
3a3b42a
Merge remote-tracking branch 'origin/master' into tyriar/74620_2
Tyriar Feb 9, 2021
f2f9d1b
Merge remote-tracking branch 'origin/master' into tyriar/74620_2
Tyriar Feb 9, 2021
7b64e24
[email protected]
Tyriar Feb 9, 2021
1abb2d9
Merge remote-tracking branch 'origin/master' into tyriar/74620_2
Tyriar Feb 10, 2021
67dda13
Move pty to shared process
Tyriar Feb 10, 2021
25c680c
Create ptyHost, bidi communication
Tyriar Feb 10, 2021
6bdc6bb
Clean up
Tyriar Feb 10, 2021
4ea18e9
Remove unneeded file, document channels
Tyriar Feb 10, 2021
5188792
Move ptyHostMain into the node folder
Tyriar Feb 10, 2021
1819dd5
Merge pull request #116389 from microsoft/tyriar_megan_sharedproc
Tyriar Feb 11, 2021
5fc19f5
ILocalPtyService -> IPtyService
Tyriar Feb 11, 2021
59264e2
Merge remote-tracking branch 'origin/master' into tyriar/megan
Tyriar Feb 11, 2021
1b72bb6
Handle ptyHost exit gracefully and restart
Tyriar Feb 11, 2021
5de7be2
TerminalProcessMainProxy -> LocalPty
Tyriar Feb 11, 2021
62dd18f
Resolve todos
Tyriar Feb 11, 2021
ff26dba
Set up proper logging in pty host
Tyriar Feb 11, 2021
94c1ceb
Merge remote-tracking branch 'origin/master' into tyriar/megan
Tyriar Feb 11, 2021
c544f38
Update distro
Tyriar Feb 11, 2021
cd95d46
Don't remove node-pty/lib
Tyriar Feb 11, 2021
a9536c3
Merge remote-tracking branch 'origin/master' into tyriar/megan
Tyriar Feb 11, 2021
00a91fc
Adopt registerSharedProcessRemoteService
Tyriar Feb 11, 2021
7aa8466
Merge remote-tracking branch 'origin/master' into tyriar/megan
Tyriar Feb 11, 2021
2869ec9
Clean up terminals when ptyHost goes down
Tyriar Feb 11, 2021
e6bc652
Merge remote-tracking branch 'origin/master' into tyriar/megan
Tyriar Feb 11, 2021
5da54d3
Dispose client on exit
Tyriar Feb 11, 2021
b49c2cb
Dispose localPtyService on shared proc
Tyriar Feb 11, 2021
781bcae
Call shutdownAll on ptyService
Tyriar Feb 12, 2021
e4d8575
Merge remote-tracking branch 'origin/master' into tyriar/megan
Tyriar Feb 12, 2021
138cfd7
Don't double dispose LocalPtyService
Tyriar Feb 12, 2021
a56ce22
Disable ptyHost restart
Tyriar Feb 12, 2021
4e1b20a
Log process tree after test suites
Tyriar Feb 12, 2021
dc4fa48
Bring ptyService into shared proc
Tyriar Feb 12, 2021
4713b13
Register ptyservice in localptyservice
Tyriar Feb 12, 2021
888752f
remove node-pty from web
Tyriar Feb 12, 2021
8912ec1
Move ptyService out of shared proc temporarily
Tyriar Feb 12, 2021
1f45db9
Disable api tests
Tyriar Feb 12, 2021
44477fb
Re-enable tests, disable terminal suite
Tyriar Feb 12, 2021
6148fed
Enable terminal tests that deal with ptys only
Tyriar Feb 12, 2021
66d300b
Enable 3 tests
Tyriar Feb 12, 2021
68f1497
Skip echo works in the default shell test
Tyriar Feb 12, 2021
a599455
Re-enable most tests
Tyriar Feb 12, 2021
7934b9d
Skip all but 2
Tyriar Feb 12, 2021
0ebe81e
Revert "Skip all but 2"
Tyriar Feb 12, 2021
0e3ec61
Revert "Re-enable most tests"
Tyriar Feb 12, 2021
6841c52
Try conpty in integration tests
Tyriar Feb 12, 2021
1b89736
Revert "Move ptyService out of shared proc temporarily"
Tyriar Feb 12, 2021
656c907
Revert "Register ptyservice in localptyservice"
Tyriar Feb 12, 2021
3d9a48e
Revert "Bring ptyService into shared proc"
Tyriar Feb 12, 2021
8853436
Remove ps tree logging
Tyriar Feb 12, 2021
0e16b7a
Simplify echo works in the default shell
Tyriar Feb 12, 2021
90f344f
Skip echo test again
Tyriar Feb 13, 2021
982b28f
Merge remote-tracking branch 'origin/main' into tyriar/megan
Tyriar Feb 16, 2021
3859ba9
Merge remote-tracking branch 'origin/main' into tyriar/megan
Tyriar Feb 16, 2021
35abaaf
Log all lines in failing test
Tyriar Feb 16, 2021
994ad37
Log more in test
Tyriar Feb 16, 2021
e091e89
Include lib in node-pty
Tyriar Feb 16, 2021
939038a
Recursively include lib
Tyriar Feb 16, 2021
14923b5
Allow conoutSocketWorker in unpacked asar
Tyriar Feb 16, 2021
c41fb76
Re-enable all tests
Tyriar Feb 16, 2021
6f23480
Remove bundling changes
Tyriar Feb 16, 2021
cb95415
Revert back to old node-pty
Tyriar Feb 18, 2021
16510df
Remove logs from test
Tyriar Feb 18, 2021
a6cc654
Re-enable pty host restarting
Tyriar Feb 18, 2021
666351b
Merge remote-tracking branch 'origin/main' into tyriar/megan
Tyriar Feb 18, 2021
da00865
Update distro
Tyriar Feb 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 29 additions & 37 deletions extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { window, Pseudoterminal, EventEmitter, TerminalDimensions, workspace, ConfigurationTarget, Disposable, UIKind, env, EnvironmentVariableMutatorType, EnvironmentVariableMutator, extensions, ExtensionContext, TerminalOptions, ExtensionTerminalOptions, Terminal } from 'vscode';
import { doesNotThrow, equal, deepEqual, throws } from 'assert';
import { doesNotThrow, equal, deepEqual, throws, strictEqual } from 'assert';
import { assertNoRpc } from '../utils';

// Disable terminal tests:
Expand All @@ -19,8 +19,6 @@ import { assertNoRpc } from '../utils';
extensionContext = (global as any).testExtensionContext;

const config = workspace.getConfiguration('terminal.integrated');
// Disable conpty in integration tests because of https://github.com/microsoft/vscode/issues/76548
await config.update('windowsEnableConpty', false, ConfigurationTarget.Global);
// Disable exit alerts as tests may trigger then and we're not testing the notifications
await config.update('showExitAlert', false, ConfigurationTarget.Global);
// Canvas may cause problems when running in a container
Expand Down Expand Up @@ -57,49 +55,43 @@ import { assertNoRpc } from '../utils';
});
});

(process.platform === 'linux' ? test.skip : test)('echo works in the default shell', (done) => {
disposables.push(window.onDidOpenTerminal(term => {
try {
equal(terminal, term);
} catch (e) {
done(e);
return;
}
let data = '';
const dataDisposable = window.onDidWriteTerminalData(e => {
try {
equal(terminal, e.terminal);
} catch (e) {
done(e);
return;
}
data += e.data;
if (data.indexOf(expected) !== 0) {
dataDisposable.dispose();
terminal.dispose();
disposables.push(window.onDidCloseTerminal(() => {
done();
}));
}
test('echo works in the default shell', async () => {
const terminal = await new Promise<Terminal>(r => {
disposables.push(window.onDidOpenTerminal(t => {
strictEqual(terminal, t);
r(terminal);
}));
// Use a single character to avoid winpty/conpty issues with injected sequences
const terminal = window.createTerminal({
env: { TEST: '`' }
});
disposables.push(dataDisposable);
}));
// Use a single character to avoid winpty/conpty issues with injected sequences
const expected = '`';
const terminal = window.createTerminal({
env: {
TEST: '`'
}
terminal.show();
});
terminal.show();
doesNotThrow(() => {

let data = '';
await new Promise<void>(r => {
disposables.push(window.onDidWriteTerminalData(e => {
strictEqual(terminal, e.terminal);
data += e.data;
if (data.indexOf('`') !== 0) {
r();
}
}));
// Print an environment variable value so the echo statement doesn't get matched
if (process.platform === 'win32') {
terminal.sendText(`$env:TEST`);
} else {
terminal.sendText(`echo $TEST`);
}
});

await new Promise<void>(r => {
terminal.dispose();
disposables.push(window.onDidCloseTerminal(t => {
strictEqual(terminal, t);
r();
}));
});
});

test('onDidCloseTerminal event fires when terminal is disposed', async () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.54.0",
"distro": "918cb1526e6442d55ef2c4e617f77afe48f6a3fe",
"distro": "bb7724655cd33d9e9fa31c98ca48a306147c276a",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -222,4 +222,4 @@
"elliptic": "^6.5.3",
"nwmatcher": "^1.4.4"
}
}
}
12 changes: 12 additions & 0 deletions src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ import { DeprecatedExtensionsCleaner } from 'vs/code/electron-browser/sharedProc
import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { join } from 'vs/base/common/path';
import { TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
import { LocalPtyService } from 'vs/platform/terminal/electron-browser/localPtyService';
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
import { UserDataSyncChannel } from 'vs/platform/userDataSync/common/userDataSyncServiceIpc';

class SharedProcessMain extends Disposable {
Expand Down Expand Up @@ -259,6 +262,10 @@ class SharedProcessMain extends Disposable {
services.set(IUserDataSyncResourceEnablementService, new SyncDescriptor(UserDataSyncResourceEnablementService));
services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService));

// Terminal
const localPtyService = this._register(new LocalPtyService(logService));
services.set(ILocalPtyService, localPtyService);

return new InstantiationService(services);
}

Expand Down Expand Up @@ -296,6 +303,11 @@ class SharedProcessMain extends Disposable {
const userDataAutoSync = this._register(accessor.get(IInstantiationService).createInstance(UserDataAutoSyncService));
const userDataAutoSyncChannel = new UserDataAutoSyncChannel(userDataAutoSync);
this.server.registerChannel('userDataAutoSync', userDataAutoSyncChannel);

// Terminal
const localPtyService = accessor.get(ILocalPtyService);
const localPtyChannel = ProxyChannel.fromService(localPtyService);
this.server.registerChannel(TerminalIpcChannels.LocalPty, localPtyChannel);
}

private registerErrorHandler(logService: ILogService): void {
Expand Down
Loading