Skip to content

Disable Bluetooth by default to prevent BlueZ connection popup on Linux startup#322212

Open
ayu-haker wants to merge 2 commits into
microsoft:mainfrom
ayu-haker:fix/disable-bluetooth-on-linux
Open

Disable Bluetooth by default to prevent BlueZ connection popup on Linux startup#322212
ayu-haker wants to merge 2 commits into
microsoft:mainfrom
ayu-haker:fix/disable-bluetooth-on-linux

Conversation

@ayu-haker

Copy link
Copy Markdown

Description

On Linux, VS Code requests Bluetooth access on startup because Electron initiates a connection to BlueZ (Linux Bluetooth daemon) early in the startup process. This causes a distracting system permission popup for users who don't even use Bluetooth.

Fix

Add --disable-bluetooth Chromium switch early in the startup sequence to prevent Electron from connecting to BlueZ.

Users who need Web Bluetooth functionality can opt in by passing --enable-bluetooth CLI flag.

Changes

  • src/main.ts: Added disable-bluetooth switch before argvConfig return, with --enable-bluetooth opt-in

Related

Fixes #134461

Electron initiates a connection to BlueZ (Linux Bluetooth daemon) on
startup, causing a Bluetooth permission popup for users who don't even
use Bluetooth. Disable Bluetooth by default using Chromium's
--disable-bluetooth switch.

Users who need Web Bluetooth can opt-in with --enable-bluetooth CLI flag.

Fixes microsoft#134461
Copilot AI review requested due to automatic review settings June 20, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Electron main entrypoint (src/main.ts) to prevent VS Code from triggering a BlueZ (Linux Bluetooth daemon) connection attempt during startup by appending Chromium’s --disable-bluetooth switch early in initialization, with an opt-in escape hatch.

Changes:

  • Append --disable-bluetooth during early command-line switch configuration to avoid BlueZ activation on startup.
  • Provide an opt-in path via --enable-bluetooth (so the disable switch is not appended).

Comment thread src/main.ts Outdated
Comment on lines +370 to +372
if (!app.commandLine.hasSwitch('enable-bluetooth')) {
app.commandLine.appendSwitch('disable-bluetooth');
}
Comment thread src/main.ts
@ayu-haker ayu-haker force-pushed the fix/disable-bluetooth-on-linux branch from dfe1fb2 to ae4e4f2 Compare June 20, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VSCode requests bluetooth access on startup

3 participants