Double Click from IDE
Double-click a file in the VS Code sidebar file tree to open it right away in the app your
system uses for that file type. Nothing else opens in between: no file manager, no
Windows Explorer, no Finder. A .pdf opens in your PDF viewer, a .psd in Photoshop, a .docx in Word. You can
also pick an app yourself, either for all files or for one extension.
The animation is an illustration of the behaviour, not a screen recording.
Installation
From GitHub Releases (VS Code and any VS Code-based editor):
- Download
double-click-from-ide-vX.Y.Z.vsix from the latest release at
https://github.com/revoockv/double-click-from-ide/releases.
- In VS Code, open the Extensions view (
Cmd+Shift+X / Ctrl+Shift+X), click ··· and choose
Install from VSIX..., then pick the downloaded file. Or run:
code --install-extension double-click-from-ide-vX.Y.Z.vsix
- Reload the window (Developer: Reload Window).
From Open VSX (Cursor, VSCodium, Windsurf, Gitpod and other editors that use Open VSX):
search for Double Click from IDE in the Extensions view, or open
https://open-vsx.org/extension/revoockv/double-click-from-ide.
Releases from GitHub are not updated automatically. To update, install the new .vsix the same
way.
How it works
| You do |
What happens |
| Single-click a file |
VS Code shows it in a preview tab, as usual. |
| Double-click a file |
The file opens in the external app, and the VS Code tab closes. |
| Right-click → Open in Default App |
The file opens in the external app. |
| Right-click → Set App Path... |
You choose the app for this extension or for all files. |
Both commands are in the file tree's right-click menu:
The app used for a file is chosen in this order:
doubleClickFromIde.appsByExtension for the file's extension
doubleClickFromIde.appPath
- The system default app for the extension:
- macOS –
open <file> (LaunchServices)
- Windows –
Invoke-Item (ShellExecute, the app associated with the extension)
- Linux –
xdg-open <file>
Settings
| Setting |
Default |
Description |
doubleClickFromIde.enabled |
true |
Open files externally on double-click. |
doubleClickFromIde.appPath |
"" |
App for all files. Empty means the system default app. |
doubleClickFromIde.appsByExtension |
{} |
App per extension, e.g. { ".pdf": "/Applications/Preview.app" }. |
doubleClickFromIde.includedExtensions |
[] |
Only these extensions open externally. Empty means all. |
doubleClickFromIde.excludedExtensions |
[] |
These extensions never open externally. |
doubleClickFromIde.closeEditorAfterOpen |
true |
Close the tab that the double-click opened. |
doubleClickFromIde.handleOpenTabs |
true |
Also catch a double-click on a file that is already open in a normal tab. |
doubleClickFromIde.doubleClickThreshold |
500 |
How long, in ms, such a file waits for the second click. |
Example: open only documents and images externally, and keep code in VS Code:
"doubleClickFromIde.includedExtensions": [".pdf", ".docx", ".xlsx", ".png", ".jpg", ".psd"],
"doubleClickFromIde.appsByExtension": {
".psd": "/Applications/Adobe Photoshop 2026/Adobe Photoshop 2026.app",
".png": "C:\\Program Files\\IrfanView\\i_view64.exe"
}
App path formats:
- macOS – an
.app bundle (/Applications/Preview.app) or an executable.
- Windows – an
.exe (C:\Program Files\...\app.exe).
- Linux – an executable (
/usr/bin/gimp).
Commands
- Double Click from IDE: Open in Default App
- Double Click from IDE: Set App Path... asks whether the app is for all files or for the current extension, then opens a file picker.
- Double Click from IDE: Reset App Path to Default
How the double-click is detected
VS Code has no double-click event for its sidebar file tree. A double-click reaches VS Code as
"open this file in a normal (pinned) tab", and the extension works from that:
- File with no tab. The first click opens a preview, and the second click pins it. When a
preview turns into a normal tab and no edit caused it, that is a double-click. This works no
matter how long the preview has been open.
- File already open in a normal tab. The first click only switches to that tab, so the
second click would be lost. The extension reopens the tab right away as a preview, in the same
place and with the same cursor. If no second click comes within
doubleClickThreshold ms, the
tab becomes a normal tab again. You can turn this off with handleOpenTabs.
Limitations
workbench.editor.enablePreview must be on. If it is off, the extension turns it on the first
time it runs and shows a short notice, so it works right after install. If you turn preview
off again later, the extension asks before turning it back on. Uninstalling the extension
leaves preview on.
- A single click opens a preview tab, and the next single click replaces it (standard VS Code
behaviour).
- Some things count as a double-click even though they are not one: pinning a preview tab
without editing it, by double-clicking its title or with Keep Editor, or opening it again
from Quick Open.
- A file with unsaved changes is never opened externally.
- Only local files (
file: scheme). Files in Remote SSH, WSL or containers can't be opened by a
local app.
Development
npm ci
npm run lint
npm test # compiles, then runs node:test unit tests
npm run package # builds the .vsix
Press F5 in VS Code to start an Extension Development Host.
Git rules
These rules are the same as in
revoockv-flutter-clean-arch.
- Branches:
feature/, fix/, refactor/, docs/, test/, style/ or hotfix/, followed
by <num>-<kebab-name> (e.g. feature/001-user-profile), plus release/X.Y.Z. Branches start
from develop; hotfixes start from main.
- Commits:
[TYPE-NUM] short imperative description, where NUM is the branch number, e.g.
[FEAT-003] open file externally on explorer double-click. Releases use [RELEASE-X.Y.Z] ….
Subjects are at most 72 characters. Merges use --no-ff with a message in the same format.
- Tags: annotated,
vX.Y.Z.
Turn on the local hooks once per clone:
git config core.hooksPath .githooks
commit-msg checks the commit message format.
pre-push runs lint and the unit tests before every push. macOS is tested this way,
locally; CI runs Ubuntu and Windows.
CI runs the same check (scripts/check-git-rules.mjs) on every push and pull request.
CI/CD
ci.yml runs on every push and pull request:
- git rules
- lint and unit tests on Ubuntu and Windows
- a
.vsix build, uploaded as a workflow artifact
release.yml runs on a vX.Y.Z tag:
- Runs the tests and checks that the tag matches
package.json.
- Creates a GitHub release with the
.vsix and the CHANGELOG.md notes.
- Publishes to the VS Code Marketplace (
VSCE_PAT secret) and to Open VSX (OVSX_PAT
secret), but only when those secrets are set.
Releasing
One-time setup:
- Create the GitHub repository
revoockv/double-click-from-ide (it must match repository in
package.json). Push main, develop and the tags:
git remote add origin git@github.com:revoockv/double-click-from-ide.git
git push -u origin main develop --follow-tags
- Open VSX (no Microsoft account needed):
- Sign in at https://open-vsx.org with GitHub.
- In your profile, sign the Eclipse publisher agreement (needs a free Eclipse account).
- Create an access token, then the namespace that matches
publisher:
npx ovsx create-namespace revoockv -p <token>
- In the GitHub repository, go to Settings → Secrets and variables → Actions and add
OVSX_PAT with the token.
- VS Code Marketplace (optional, needs a Microsoft account):
- Create the publisher
revoockv at https://marketplace.visualstudio.com/manage.
- Create an Azure DevOps personal access token:
- Organization: All accessible organizations
- Scope: Marketplace → Manage
- Add it as the
VSCE_PAT secret.
Each secret is optional: the workflow skips any store whose secret is not set.
Each release:
- Create
release/X.Y.Z from develop.
- Bump the version in
package.json, and in CHANGELOG.md rename [Unreleased] to
[X.Y.Z] - date.
- Merge into
main with --no-ff, add an annotated tag vX.Y.Z, and merge back into
develop.
- Push
main, develop and the tag. The Release workflow then:
- checks that the tag matches
package.json;
- creates the GitHub release with the
.vsix;
- publishes to Open VSX (
OVSX_PAT) and to the Marketplace (VSCE_PAT), if their secrets
are set.
License
MIT