|
| 1 | +diff --git code-server/lib/vscode/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts code-server/lib/vscode/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts |
| 2 | +index da0388a5435..fb91e3665c5 100644 |
| 3 | +--- code-server/lib/vscode/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts |
| 4 | ++++ code-server/lib/vscode/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts |
| 5 | +@@ -132,9 +132,9 @@ export class ExternalTerminalContribution extends Disposable implements IWorkben |
| 6 | + when: shouldShowExternalKindOnLocal |
| 7 | + }; |
| 8 | + |
| 9 | +- |
| 10 | +- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInTerminalMenuItem); |
| 11 | +- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInIntegratedTerminalMenuItem); |
| 12 | ++ // 屏蔽右键打开的终端 |
| 13 | ++ //MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInTerminalMenuItem); |
| 14 | ++ //MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInIntegratedTerminalMenuItem); |
| 15 | + |
| 16 | + this._register(this._configurationService.onDidChangeConfiguration(e => { |
| 17 | + if (e.affectsConfiguration('terminal.explorerKind') || e.affectsConfiguration('terminal.external')) { |
| 18 | +diff --git code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.ts code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.ts |
| 19 | +index 152d14d7a9b..589cb6e0366 100644 |
| 20 | +--- code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.ts |
| 21 | ++++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.ts |
| 22 | +@@ -449,6 +449,11 @@ export class TerminalService extends Disposable implements ITerminalService { |
| 23 | + this._logService.trace('Pty host ready'); |
| 24 | + } |
| 25 | + |
| 26 | ++ private _isTerminalDisabled(): boolean { |
| 27 | ++ return true |
| 28 | ++ } |
| 29 | ++ |
| 30 | ++ |
| 31 | + private async _reconnectToRemoteTerminals(): Promise<void> { |
| 32 | + const remoteAuthority = this._environmentService.remoteAuthority; |
| 33 | + if (!remoteAuthority) { |
| 34 | +@@ -973,6 +978,11 @@ export class TerminalService extends Disposable implements ITerminalService { |
| 35 | + } |
| 36 | + |
| 37 | + async createTerminal(options?: ICreateTerminalOptions): Promise<ITerminalInstance> { |
| 38 | ++ |
| 39 | ++ if (this._isTerminalDisabled()) { |
| 40 | ++ this._notificationService.info('集成终端已被管理员禁用,无法创建'); |
| 41 | ++ return; |
| 42 | ++ } |
| 43 | + // Await the initialization of available profiles as long as this is not a pty terminal or a |
| 44 | + // local terminal in a remote workspace as profile won't be used in those cases and these |
| 45 | + // terminals need to be launched before remote connections are established. |
0 commit comments