From 8ffe5997965e2be5c30ef5c8ecd9717fb286a61d Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 19 Nov 2020 11:24:52 -0600 Subject: [PATCH] Add notes on unimplemented terminal events --- ci/dev/vscode.patch | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ci/dev/vscode.patch b/ci/dev/vscode.patch index 3d7633753..17ee41304 100644 --- a/ci/dev/vscode.patch +++ b/ci/dev/vscode.patch @@ -1466,10 +1466,10 @@ index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78 +} diff --git a/src/vs/server/node/channel.ts b/src/vs/server/node/channel.ts new file mode 100644 -index 0000000000000000000000000000000000000000..95d0d3c51e4a25a9d7d0cada90d031c79bd86380 +index 0000000000000000000000000000000000000000..7081bbf178c660803830675a4d8d596c5d0b7821 --- /dev/null +++ b/src/vs/server/node/channel.ts -@@ -0,0 +1,860 @@ +@@ -0,0 +1,869 @@ +import { field, logger } from '@coder/logger'; +import { Server } from '@coder/node-browser'; +import * as os from 'os'; @@ -2042,13 +2042,17 @@ index 0000000000000000000000000000000000000000..95d0d3c51e4a25a9d7d0cada90d031c7 + this.dispose(); + }); + -+ // TODO: exec command event ++ // TODO: I think `execCommand` must have something to do with running ++ // commands on the terminal that will do things in VS Code but we already ++ // have that functionality via a socket so I'm not sure what this is for. + // type: 'execCommand'; + // reqId: number; + // commandId: string; + // commandArgs: any[]; + -+ // TODO: orphan question event ++ // TODO: Maybe this is to ask if the terminal is currently attached to ++ // anything? But we already know that on account of whether anything is ++ // listening to our event emitter. + // type: 'orphan?'; + } + @@ -2307,16 +2311,21 @@ index 0000000000000000000000000000000000000000..95d0d3c51e4a25a9d7d0cada90d031c7 + return this.getTerminal(args.id).getCwd(); + } + -+ private async sendCommandResultToTerminalProcess(args: terminal.ISendCommandResultToTerminalProcessArguments): Promise { ++ private async sendCommandResultToTerminalProcess(_: terminal.ISendCommandResultToTerminalProcessArguments): Promise { ++ // NOTE: Not required unless we implement the `execCommand` event, see above. + throw new Error('not implemented'); + } + -+ private async orphanQuestionReply(args: terminal.IOrphanQuestionReplyArgs): Promise { ++ private async orphanQuestionReply(_: terminal.IOrphanQuestionReplyArgs): Promise { ++ // NOTE: Not required unless we implement the `orphan?` event, see above. + throw new Error('not implemented'); + } + + private async listTerminals(_: terminal.IListTerminalsArgs): Promise { -+ // TODO: args.isInitialization ++ // TODO: args.isInitialization. Maybe this is to have slightly different ++ // behavior when first listing terminals but I don't know what you'd want to ++ // do differently. Maybe it's to reset the terminal dispose timeouts or ++ // something like that, but why not do it each time you list? + return Promise.all(Array.from(this.terminals).map(async ([id, terminal]) => { + const cwd = await terminal.getCwd(); + return {