diff --git a/build/hygiene.js b/build/hygiene.js index 692627b192..ee269ac6ed 100644 --- a/build/hygiene.js +++ b/build/hygiene.js @@ -114,6 +114,8 @@ const indentationFilter = [ '!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts', '!extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts', '!resources/linux/snap/electron-launch', + '!extensions/markdown-language-features/media/*.js', + '!extensions/simple-browser/media/*.js', '!resources/xlf/LocProject.json', // {{SQL CARBON EDIT}} '!build/**/*' // {{SQL CARBON EDIT}} ]; diff --git a/extensions/git-ui/src/main.ts b/extensions/git-ui/src/main.ts index 12eedaa4d8..e54f379657 100644 --- a/extensions/git-ui/src/main.ts +++ b/extensions/git-ui/src/main.ts @@ -11,20 +11,21 @@ export async function deactivate(): Promise { } export async function activate(context: ExtensionContext): Promise { - context.subscriptions.push(commands.registerCommand('git.credential', async (data: any) => { - try { - const { stdout, stderr } = await exec(`git credential ${data.command}`, { - stdin: data.stdin, - env: Object.assign(process.env, { GIT_TERMINAL_PROMPT: '0' }) - }); - return { stdout, stderr, code: 0 }; - } catch ({ stdout, stderr, error }) { - const code = error.code || 0; - if (stderr.indexOf('terminal prompts disabled') !== -1) { - stderr = ''; - } - return { stdout, stderr, code }; - } + context.subscriptions.push(commands.registerCommand('git.credential', async (_data: any) => { + return { stdout: '', stderr: '', code: 0 }; + // try { + // const { stdout, stderr } = await exec(`git credential ${data.command}`, { + // stdin: data.stdin, + // env: Object.assign(process.env, { GIT_TERMINAL_PROMPT: '0' }) + // }); + // return { stdout, stderr, code: 0 }; + // } catch ({ stdout, stderr, error }) { + // const code = error.code || 0; + // if (stderr.indexOf('terminal prompts disabled') !== -1) { + // stderr = ''; + // } + // return { stdout, stderr, code }; + // } })); } diff --git a/package.json b/package.json index 2e623176cd..71f7465f66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "azuredatastudio", "version": "1.28.0", - "distro": "4462480cd081b5729600b15921dbb445b46b0de9", + "distro": "0de18a407aaa6294c15918753b6032c7bb919aaf", "author": { "name": "Microsoft Corporation" }, diff --git a/src/vs/workbench/api/node/extHostCLIServer.ts b/src/vs/workbench/api/node/extHostCLIServer.ts index e26facdbe6..eed4c05678 100644 --- a/src/vs/workbench/api/node/extHostCLIServer.ts +++ b/src/vs/workbench/api/node/extHostCLIServer.ts @@ -33,13 +33,8 @@ export interface StatusPipeArgs { type: 'status'; } -export interface RunCommandPipeArgs { - type: 'command'; - command: string; - args: any[]; -} -export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | RunCommandPipeArgs | OpenExternalCommandPipeArgs; +export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs; export interface ICommandsExecuter { executeCommand(id: string, ...args: any[]): Promise; @@ -91,10 +86,6 @@ export class CLIServerBase { case 'status': this.getStatus(data, res); break; - case 'command': - this.runCommand(data, res) - .catch(this.logService.error); - break; default: res.writeHead(404); res.write(`Unknown message type: ${data.type}`, err => { @@ -137,7 +128,7 @@ export class CLIServerBase { const waitMarkerFileURI = waitMarkerFilePath ? URI.file(waitMarkerFilePath) : undefined; const preferNewWindow = !forceReuseWindow && !waitMarkerFileURI && !addMode; const windowOpenArgs: IOpenWindowOptions = { forceNewWindow, diffMode, addMode, gotoLineMode, forceReuseWindow, preferNewWindow, waitMarkerFileURI }; - this._commands.executeCommand('_files.windowOpen', urisToOpen, windowOpenArgs); + this._commands.executeCommand('_remoteCLI.windowOpen', urisToOpen, windowOpenArgs); } res.writeHead(200); res.end(); @@ -153,7 +144,7 @@ export class CLIServerBase { private async getStatus(data: StatusPipeArgs, res: http.ServerResponse) { try { - const status = await this._commands.executeCommand('_issues.getSystemStatus'); + const status = await this._commands.executeCommand('_remoteCLI.getSystemStatus'); res.writeHead(200); res.write(status); res.end(); @@ -168,28 +159,6 @@ export class CLIServerBase { } } - private async runCommand(data: RunCommandPipeArgs, res: http.ServerResponse) { - try { - const { command, args } = data; - const result = await this._commands.executeCommand(command, ...args); - res.writeHead(200); - res.write(JSON.stringify(result), err => { - if (err) { - this.logService.error(err); - } - }); - res.end(); - } catch (err) { - res.writeHead(500); - res.write(String(err), err => { - if (err) { - this.logService.error(err); - } - }); - res.end(); - } - } - dispose(): void { this._server.close(); diff --git a/src/vs/workbench/contrib/terminal/browser/remoteTerminalService.ts b/src/vs/workbench/contrib/terminal/browser/remoteTerminalService.ts index 4725e36619..7c240e04bf 100644 --- a/src/vs/workbench/contrib/terminal/browser/remoteTerminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/remoteTerminalService.ts @@ -255,6 +255,12 @@ export class RemoteTerminalProcess extends Disposable implements ITerminalChildP private async _execCommand(event: IRemoteTerminalProcessExecCommandEvent): Promise { const reqId = event.reqId; + const commandId = event.commandId; + const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions']; + if (!allowedCommands.includes(commandId)) { + this._remoteTerminalChannel.sendCommandResultToTerminalProcess(this._remoteTerminalId, reqId, true, 'Invalid remote cli command: ' + commandId); + return; + } const commandArgs = event.commandArgs.map(arg => revive(arg)); try { const result = await this._commandService.executeCommand(event.commandId, ...commandArgs);