Skip to content

Commit a7989f0

Browse files
committed
Fix microsoft#35361: fix native tabs on macOS 10.13
macOS 10.13 mistakenly enables a compatibility option on VS Code and VS Code Insiders because their bundle IDs begin with "com.microsoft.". This breaks native tabs. Explicitly disable the compatibility patch using NSUserDefaults. Note that Code-OSS is not affected by the bug, since its bundle ID is "com.visualstudio.code.oss". To test this behaviour, change darwinBundleIdentifier in product.json.
1 parent d5ad357 commit a7989f0

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • src/vs/code/electron-main

src/vs/code/electron-main/app.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'use strict';
77

8-
import { app, ipcMain as ipc } from 'electron';
8+
import { app, ipcMain as ipc, systemPreferences } from 'electron';
99
import * as platform from 'vs/base/common/platform';
1010
import { WindowsManager } from 'vs/code/electron-main/windows';
1111
import { IWindowsService, OpenContext, ActiveWindowManager } from 'vs/platform/windows/common/windows';
@@ -274,6 +274,16 @@ export class CodeApplication {
274274
app.setAppUserModelId(product.win32AppUserModelId);
275275
}
276276

277+
// Fix native tabs on macOS 10.13
278+
// macOS enables a compatibility patch for any bundle ID beginning with
279+
// "com.microsoft.", which breaks native tabs for VS Code.
280+
// Explicitly opt out of the patch here before creating any windows.
281+
// https://github.com/Microsoft/vscode/issues/35361#issuecomment-399794085
282+
283+
if (platform.isMacintosh) {
284+
systemPreferences.registerDefaults({ NSUseImprovedLayoutPass: true });
285+
}
286+
277287
// Create Electron IPC Server
278288
this.electronIpcServer = new ElectronIPCServer();
279289

0 commit comments

Comments
 (0)