Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Code v99.99.999

## Unreleased

## [4.128.0](https://github.com/coder/code-server/releases/tag/v4.128.0) - 2026-07-11

Code v1.128.0

### Changed
Expand Down
4 changes: 2 additions & 2 deletions ci/helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.42.0
version: 3.43.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 4.127.0
appVersion: 4.128.0
2 changes: 1 addition & 1 deletion ci/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replicaCount: 1

image:
repository: codercom/code-server
tag: '4.127.0'
tag: '4.128.0'
pullPolicy: Always

# Specifies one or more secrets to be used when pulling images from a
Expand Down
45 changes: 45 additions & 0 deletions patches/disable_terminal_keybind.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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
index da0388a5435..fb91e3665c5 100644
--- 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
@@ -132,9 +132,9 @@ export class ExternalTerminalContribution extends Disposable implements IWorkben
when: shouldShowExternalKindOnLocal
};

-
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInTerminalMenuItem);
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInIntegratedTerminalMenuItem);
+ // 屏蔽右键打开的终端
+ //MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInTerminalMenuItem);
+ //MenuRegistry.appendMenuItem(MenuId.ExplorerContext, this._openInIntegratedTerminalMenuItem);

this._register(this._configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('terminal.explorerKind') || e.affectsConfiguration('terminal.external')) {
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
index 152d14d7a9b..589cb6e0366 100644
--- code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.ts
@@ -449,6 +449,11 @@ export class TerminalService extends Disposable implements ITerminalService {
this._logService.trace('Pty host ready');
}

+ private _isTerminalDisabled(): boolean {
+ return true
+ }
+
+
private async _reconnectToRemoteTerminals(): Promise<void> {
const remoteAuthority = this._environmentService.remoteAuthority;
if (!remoteAuthority) {
@@ -973,6 +978,11 @@ export class TerminalService extends Disposable implements ITerminalService {
}

async createTerminal(options?: ICreateTerminalOptions): Promise<ITerminalInstance> {
+
+ if (this._isTerminalDisabled()) {
+ this._notificationService.info('集成终端已被管理员禁用,无法创建');
+ return;
+ }
// Await the initialization of available profiles as long as this is not a pty terminal or a
// local terminal in a remote workspace as profile won't be used in those cases and these
// terminals need to be launched before remote connections are established.
Empty file added patches/qian-changes.diff
Empty file.
3 changes: 3 additions & 0 deletions patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ trusted-domains.diff
signature-verification.diff
copilot.diff
app-name.diff
disable_terminal_keybind.diff
whitelist-keybingding.diff
ui-hidden.diff
720 changes: 720 additions & 0 deletions patches/ui-hidden.diff

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions patches/whitelist-keybingding.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git code-server/lib/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts
index 5db49b2be12..b6c6670231a 100644
--- code-server/lib/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.ts
@@ -184,6 +184,36 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
readonly contribution: KeybindingsSchemaContribution;
}> = [];
private readonly kbsJsonSchema: KeybindingsJsonSchema;
+ protected override _dispatch(e: IKeyboardEvent,target: never): boolean {
+ // 白名单允许的快捷键组合
+ const allowSet = new Set<string>([
+ 'ctrl+keyc',
+ 'ctrl+keyv',
+ 'ctrl+keyx',
+ 'ctrl+keyz',
+ 'ctrl+keys',
+ 'ctrl+keyf',
+ ]);
+
+ // 组装当前按键标识(仅处理Ctrl组合,Mac meta单独区分)
+ let keyLabel = '';
+ if (e.ctrlKey && !e.metaKey) {
+ keyLabel = `ctrl+${e.code.toLowerCase()}`;
+ }
+ // Mac系统兼容 meta(cmd) 版本
+ if (e.metaKey && !e.ctrlKey) {
+ keyLabel = `ctrl+${e.code.toLowerCase()}`;
+ }
+ // 不在白名单,直接返回false,不执行任何快捷键逻辑
+ if (!allowSet.has(keyLabel)) {
+ return false;
+ }
+
+ // 白名单按键放行,走原生分发逻辑
+ return super._dispatch(e, target);
+}
+
+

constructor(
@IContextKeyService contextKeyService: IContextKeyService,
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"sourceMap": false,
"tsBuildInfoFile": "./.cache/tsbuildinfo",
"incremental": true,
"typeRoots": [
Expand Down