@@ -1466,10 +1466,10 @@ index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78
14661466+ }
14671467diff --git a/src/vs/server/node/channel.ts b/src/vs/server/node/channel.ts
14681468new file mode 100644
1469- index 0000000000000000000000000000000000000000..609c4d1cb43f52f92906b901c14c790f4536468f
1469+ index 0000000000000000000000000000000000000000..6fb1ada50628d3826a493c6e1b58f27a8be428bb
14701470--- /dev/null
14711471+++ b/src/vs/server/node/channel.ts
1472- @@ -0,0 +1,360 @@
1472+ @@ -0,0 +1,437 @@
14731473+ import { Server } from '@coder/node-browser';
14741474+ import * as path from 'path';
14751475+ import { VSBuffer } from 'vs/base/common/buffer';
@@ -1494,6 +1494,8 @@ index 0000000000000000000000000000000000000000..609c4d1cb43f52f92906b901c14c790f
14941494+ import { getTranslations } from 'vs/server/node/nls';
14951495+ import { getUriTransformer } from 'vs/server/node/util';
14961496+ import { IFileChangeDto } from 'vs/workbench/api/common/extHost.protocol';
1497+ + import * as terminal from 'vs/workbench/contrib/terminal/common/remoteTerminalChannel';
1498+ + import { ITerminalLaunchError } from 'vs/workbench/contrib/terminal/common/terminal';
14971499+ import { ExtensionScanner, ExtensionScannerInput } from 'vs/workbench/services/extensions/node/extensionPoints';
14981500+
14991501+ /**
@@ -1830,6 +1832,81 @@ index 0000000000000000000000000000000000000000..609c4d1cb43f52f92906b901c14c790f
18301832+ this._$onMessage.fire(message);
18311833+ }
18321834+ }
1835+ +
1836+ + export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnectionContext>, IDisposable {
1837+ + public listen(_: RemoteAgentConnectionContext, event: string, args?: any): Event<any> {
1838+ + switch (event) {
1839+ + case '$onTerminalProcessEvent': return this.onTerminalProcessEvent(args);
1840+ + }
1841+ +
1842+ + throw new Error(`Invalid listen '${event}'`);
1843+ + }
1844+ +
1845+ + private onTerminalProcessEvent(args: terminal.IOnTerminalProcessEventArguments): Event<terminal.IRemoteTerminalProcessEvent> {
1846+ + throw new Error('not implemented');
1847+ + }
1848+ +
1849+ + public call(_: unknown, command: string, args?: any): Promise<any> {
1850+ + switch (command) {
1851+ + case '$createTerminalProcess': return this.createTerminalProcess(args);
1852+ + case '$startTerminalProcess': return this.startTerminalProcess(args);
1853+ + case '$sendInputToTerminalProcess': return this.sendInputToTerminalProcess(args);
1854+ + case '$shutdownTerminalProcess': return this.shutdownTerminalProcess(args);
1855+ + case '$resizeTerminalProcess': return this.resizeTerminalProcess(args);
1856+ + case '$getTerminalInitialCwd': return this.getTerminalInitialCwd(args);
1857+ + case '$getTerminalCwd': return this.getTerminalCwd(args);
1858+ + case '$sendCommandResultToTerminalProcess': return this.sendCommandResultToTerminalProcess(args);
1859+ + case '$orphanQuestionReply': return this.orphanQuestionReply(args[0]);
1860+ + case '$listTerminals': return this.listTerminals(args[0]);
1861+ + }
1862+ +
1863+ + throw new Error(`Invalid call '${command}'`);
1864+ + }
1865+ +
1866+ + public dispose(): void {
1867+ + // Nothing yet.
1868+ + }
1869+ +
1870+ + private async createTerminalProcess(args: terminal.ICreateTerminalProcessArguments): Promise<terminal.ICreateTerminalProcessResult> {
1871+ + throw new Error(`not implemented`);
1872+ + }
1873+ +
1874+ + private async startTerminalProcess(args: terminal.IStartTerminalProcessArguments): Promise<ITerminalLaunchError | void> {
1875+ + throw new Error('not implemented');
1876+ + }
1877+ +
1878+ + private async sendInputToTerminalProcess(args: terminal.ISendInputToTerminalProcessArguments): Promise<void> {
1879+ + throw new Error('not implemented');
1880+ + }
1881+ +
1882+ + private async shutdownTerminalProcess(args: terminal.IShutdownTerminalProcessArguments): Promise<void> {
1883+ + throw new Error('not implemented');
1884+ + }
1885+ +
1886+ + private async resizeTerminalProcess(args: terminal.IResizeTerminalProcessArguments): Promise<void> {
1887+ + throw new Error('not implemented');
1888+ + }
1889+ +
1890+ + private async getTerminalInitialCwd(args: terminal.IGetTerminalInitialCwdArguments): Promise<string> {
1891+ + throw new Error('not implemented');
1892+ + }
1893+ +
1894+ + private async getTerminalCwd(args: terminal.IGetTerminalCwdArguments): Promise<string> {
1895+ + throw new Error('not implemented');
1896+ + }
1897+ +
1898+ + private async sendCommandResultToTerminalProcess(args: terminal.ISendCommandResultToTerminalProcessArguments): Promise<void> {
1899+ + throw new Error('not implemented');
1900+ + }
1901+ +
1902+ + private async orphanQuestionReply(args: terminal.IOrphanQuestionReplyArgs): Promise<void> {
1903+ + throw new Error('not implemented');
1904+ + }
1905+ +
1906+ + private async listTerminals(args: terminal.IListTerminalsArgs): Promise<terminal.IRemoteTerminalDescriptionDto[]> {
1907+ + throw new Error('not implemented');
1908+ + }
1909+ + }
18331910diff --git a/src/vs/server/node/connection.ts b/src/vs/server/node/connection.ts
18341911new file mode 100644
18351912index 0000000000000000000000000000000000000000..93062cadc627c61e0829c27a72894b81e6a0e039
@@ -2585,10 +2662,10 @@ index 0000000000000000000000000000000000000000..0d9310038c0ca378579652d89bc8ac84
25852662+ }
25862663diff --git a/src/vs/server/node/server.ts b/src/vs/server/node/server.ts
25872664new file mode 100644
2588- index 0000000000000000000000000000000000000000..8424965d9c79d34e5513e4cfe543718521ad82c7
2665+ index 0000000000000000000000000000000000000000..ebd3fbdf7554c63d23ad6bd0e51e0a35a94509dd
25892666--- /dev/null
25902667+++ b/src/vs/server/node/server.ts
2591- @@ -0,0 +1,300 @@
2668+ @@ -0,0 +1,302 @@
25922669+ import { field } from '@coder/logger';
25932670+ import * as fs from 'fs';
25942671+ import * as net from 'net';
@@ -2639,13 +2716,14 @@ index 0000000000000000000000000000000000000000..8424965d9c79d34e5513e4cfe5437185
26392716+ import { INodeProxyService, NodeProxyChannel } from 'vs/server/common/nodeProxy';
26402717+ import { TelemetryChannel } from 'vs/server/common/telemetry';
26412718+ import { Query, VscodeOptions, WorkbenchOptions } from 'vs/server/ipc';
2642- + import { ExtensionEnvironmentChannel, FileProviderChannel, NodeProxyService } from 'vs/server/node/channel';
2719+ + import { ExtensionEnvironmentChannel, FileProviderChannel, NodeProxyService, TerminalProviderChannel } from 'vs/server/node/channel';
26432720+ import { Connection, ExtensionHostConnection, ManagementConnection } from 'vs/server/node/connection';
26442721+ import { TelemetryClient } from 'vs/server/node/insights';
26452722+ import { logger } from 'vs/server/node/logger';
26462723+ import { getLocaleFromConfig, getNlsConfiguration } from 'vs/server/node/nls';
26472724+ import { Protocol } from 'vs/server/node/protocol';
26482725+ import { getUriTransformer } from 'vs/server/node/util';
2726+ + import { REMOTE_TERMINAL_CHANNEL_NAME } from 'vs/workbench/contrib/terminal/common/remoteTerminalChannel';
26492727+ import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from "vs/workbench/services/remote/common/remoteAgentFileSystemChannel";
26502728+ import { RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService';
26512729+
@@ -2877,6 +2955,7 @@ index 0000000000000000000000000000000000000000..8424965d9c79d34e5513e4cfe5437185
28772955+ this.ipc.registerChannel('nodeProxy', new NodeProxyChannel(accessor.get(INodeProxyService)));
28782956+ this.ipc.registerChannel('localizations', <IServerChannel<any>>createChannelReceiver(accessor.get(ILocalizationsService)));
28792957+ this.ipc.registerChannel(REMOTE_FILE_SYSTEM_CHANNEL_NAME, new FileProviderChannel(environmentService, logService));
2958+ + this.ipc.registerChannel(REMOTE_TERMINAL_CHANNEL_NAME, new TerminalProviderChannel());
28802959+ resolve(new ErrorTelemetry(telemetryService));
28812960+ });
28822961+ });
0 commit comments