Open files, folders in a new window with modifier-click from the File menu
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Summary
When using `File > Open Folder...`, modifier-clicking the menu item should open the selected folder in a new window. VS Code already has commands for opening folders/workspaces in a new window, but this behavior is not consistently available from the `Open Folder...` menu item, especially through the custom menubar.
Current behavior
- Selecting `File > Open Folder...` opens the selected folder in the current window.
- Modifier-clicking the menu item does not consistently change the behavior to open in a new window.
- This feels inconsistent with `File > Open Recent`, where modifier-clicking an entry can open it in a new window.
Proposed behavior
- Windows/Linux: `Ctrl` or `Shift` + click `File > Open Folder...` opens the selected folder in a new window.
- macOS: `Cmd` or `Option` + click `File > Open Folder...` opens the selected folder in a new window.
- Normal click keeps the current behavior.
- The behavior should work for both native menubar and custom renderer menubar paths.
- Reuse existing commands such as `workbench.action.files.openFolderInNewWindow` rather than introducing a new command.
Why
- Makes `File > Open Folder...` more efficient for users who want to keep the current window open.
- Aligns `File > Open Folder...` with `File > Open Recent`, where modifier-clicking an entry can open it in a new window.
- Avoids adding another visible menu item while still supporting an existing advanced interaction.
- Reduces the need to change settings or use separate commands for a common one-off action.
Reproducible example
1. Open VS Code on Windows/Linux with the custom title bar/menu bar enabled.
2. Hold `Ctrl`.
3. Click `File > Open Folder...`.
4. Select a folder.
5. Observe that the folder opens in the current window instead of a new window.
Expected behavior: the folder opens in a new window.
Acceptance criteria
- Modifier-clicking `File > Open Folder...` opens the selected folder in a new window.
- Normal clicking `File > Open Folder...` preserves existing behavior.
- Behavior works in the custom menubar.
- Behavior works in the native menubar/fallback path where applicable.
- Existing commands are reused:
- `workbench.action.files.openFolderInNewWindow`
- `workbench.action.files.openFileFolderInNewWindow`
- `workbench.action.openWorkspaceInNewWindow`
- Type checking passes and no accessibility or keyboard behavior regresses.
Notes
I searched existing issues and PRs for `Open Folder` + `new window`, `modifier`, `Ctrl`, and `openFolderInNewWindow`, but did not find an existing request specifically for modifier-clicking `File > Open Folder...`.
Contributor guide
Assessment
This issue has not been assessed yet.