Skip to content


Fix microsoft#35361: fix native tabs on macOS 10.13
Browse files Browse the repository at this point in the history
macOS 10.13 mistakenly enables a compatibility option on VS Code
and VS Code Insiders because their bundle IDs begin with
"". 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.
  • Loading branch information
zhuowei committed Jun 24, 2018
1 parent d5ad357 commit a7989f0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/vs/code/electron-main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

import { app, ipcMain as ipc } from 'electron';
import { app, ipcMain as ipc, systemPreferences } from 'electron';
import * as platform from 'vs/base/common/platform';
import { WindowsManager } from 'vs/code/electron-main/windows';
import { IWindowsService, OpenContext, ActiveWindowManager } from 'vs/platform/windows/common/windows';
Expand Down Expand Up @@ -274,6 +274,16 @@ export class CodeApplication {

// Fix native tabs on macOS 10.13
// macOS enables a compatibility patch for any bundle ID beginning with
// "", which breaks native tabs for VS Code.
// Explicitly opt out of the patch here before creating any windows.

if (platform.isMacintosh) {
systemPreferences.registerDefaults({ NSUseImprovedLayoutPass: true });

// Create Electron IPC Server
this.electronIpcServer = new ElectronIPCServer();

Expand Down

0 comments on commit a7989f0

Please sign in to comment.