Detach VS Code's integrated terminal into a standalone, resizable floating window.
What It Does
Terminal Detach allows you to pop out VS Code's built-in terminal and debug console into their own standalone, draggable, resizable floating windows — while keeping all your running processes alive and your scroll position intact.
Key Features
- Detach Terminal — Right-click any terminal tab → "Detach Terminal" to pop it into a new window
- Attach Terminal — One click to bring it back into the main VS Code panel
- Toggle with Keyboard —
Ctrl+Shift+D(Windows/Linux) orCmd+Shift+D(macOS) to instantly toggle - Debug Console Support — Detach the Debug Console too
- Session Persistence — Running processes (servers, builds, scripts) continue uninterrupted
- Scroll Position Preserved — You won't jump back to line 1 when detaching or re-attaching
- Window Memory — Position and size are remembered across VS Code restarts
- Cross-Platform — Works on Windows, macOS, and Linux
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "Terminal Detach"
- Click Install
From Open VSX Registry (for VSCodium, Gitpod, etc.)
- Open your editor
- Go to Extensions
- Search for "Terminal Detach" by AceLozabe
- Click Install
From VSIX (Manual)
- Download the
.vsixfile from the Releases page - In VS Code, go to Extensions → ... (top right) → Install from VSIX...
- Select the downloaded
.vsixfile
How to Use
Detach a Terminal
Method 1: Right-Click (Fastest)
- Open the integrated terminal (
Ctrl+``/Cmd+`) - Right-click on the terminal tab
- Select "Detach Terminal"
Method 2: Command Palette
- Press
Ctrl+Shift+P/Cmd+Shift+P - Type "Detach Terminal"
- Press Enter
Method 3: Keyboard Shortcut
- Make sure the terminal is focused
- Press
Ctrl+Shift+D(Windows/Linux) orCmd+Shift+D(macOS)
Attach (Re-Dock) a Terminal
Method 1: Right-Click
- Right-click on the detached terminal tab
- Select "Attach Terminal"
Method 2: Command Palette
- Press
Ctrl+Shift+P/Cmd+Shift+P - Type "Attach Terminal"
- Press Enter
Method 3: Keyboard Shortcut
- Press the same toggle shortcut:
Ctrl+Shift+D/Cmd+Shift+D
Detach the Debug Console
- Start a debugging session
- Open the Debug Console
- Right-click the Debug Console tab → "Detach Debug Console"
- Or use Command Palette → "Detach Debug Console"
Configuration
Open VS Code settings (Ctrl+, / Cmd+,) and search for "Terminal Detach".
| Setting | Default | Description |
|---|---|---|
terminalDetach.defaultWidth |
800 |
Default width of detached window (px) |
terminalDetach.defaultHeight |
500 |
Default height of detached window (px) |
terminalDetach.rememberPosition |
true |
Remember window position across restarts |
terminalDetach.alwaysOnTop |
false |
Keep detached windows on top of other windows |
terminalDetach.windowOpacity |
1.0 |
Window opacity (0.5 – 1.0) |
terminalDetach.showInTaskbar |
true |
Show detached windows in OS taskbar/dock |
terminalDetach.preserveScrollPosition |
true |
Keep scroll position when detaching/attaching |
terminalDetach.debugConsoleSupport |
true |
Enable detach support for Debug Console |
Example settings.json
{
"terminalDetach.defaultWidth": 1000,
"terminalDetach.defaultHeight": 600,
"terminalDetach.rememberPosition": true,
"terminalDetach.alwaysOnTop": false,
"terminalDetach.windowOpacity": 1.0,
"terminalDetach.showInTaskbar": true,
"terminalDetach.preserveScrollPosition": true,
"terminalDetach.debugConsoleSupport": true
}
Keyboard Shortcuts
| Command | Windows/Linux | macOS | When |
|---|---|---|---|
| Toggle Terminal Detach/Attach | Ctrl+Shift+D |
Cmd+Shift+D |
Terminal focused |
| Toggle Debug Console Detach/Attach | Ctrl+Shift+Alt+D |
Cmd+Shift+Alt+D |
In debug mode |
You can customize these in File → Preferences → Keyboard Shortcuts and search for "Terminal Detach".
Known Limitations
- One detached terminal at a time — Only one terminal can be detached per VS Code window. If you need multiple detached terminals, open multiple VS Code windows.
- Terminal color themes — Custom terminal color themes may reset to default when re-attached. The running processes are completely unaffected.
- Linux opacity — The
windowOpacitysetting may not work on some Linux desktop environments (depends on compositor support). - Debug console — Requires the debug console to be visible in the editor area before detaching.
- Window state — VS Code handles the actual window creation; this extension orchestrates the detach/attach commands and manages state persistence.
Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository on GitHub
- Clone your fork locally
- Install dependencies:
npm install - Open in VS Code and press
F5to run the extension in a new Extension Development Host window - Make your changes and test thoroughly
- Run tests:
npm test - Submit a Pull Request
Please read our Contributing Guidelines for more details.
Development Setup
# Clone the repo
git clone https://github.com/AceLozabe/terminal-detach.git
cd terminal-detach
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode (auto-recompile on changes)
npm run watch
# Run tests
npm test
# Package as .vsix
npm run package
Publishing to Marketplaces
Prerequisites
Before publishing, ensure you have:
- Node.js 18+ installed
- A VS Code Marketplace publisher account
- An Open VSX Registry account (Eclipse Foundation account)
Step 1: Install Publishing Tools
npm install -g @vscode/vsce ovsx
Step 2: Login to Marketplaces
VS Code Marketplace:
vsce login AceLozabe
# Enter your Personal Access Token when prompted
Open VSX Registry:
ovsx create-namespace AceLozabe
ovsx login AceLozabe
# Enter your Open VSX access token when prompted
Step 3: Update Version
Update the version in package.json following Semantic Versioning:
# Patch (bug fixes)
npm version patch
# Minor (new features, backward compatible)
npm version minor
# Major (breaking changes)
npm version major
Step 4: Publish
Publish to VS Code Marketplace:
npm run publish:marketplace
# or
vsce publish
Publish to Open VSX Registry:
npm run publish:openvsx
# or
ovsx publish
Package as .vsix (for manual distribution):
npm run package
# Creates: terminal-detach-1.0.0.vsix
Step 5: Create GitHub Release
- Go to your repo on GitHub → Releases → Draft a new release
- Choose the tag matching your version (e.g.,
v1.0.0) - Add release notes from
CHANGELOG.md - Attach the
.vsixfile - Publish the release
Adding This Extension to a New GitHub Repo
If you want to add this extension code to a newly created GitHub repository:
Step 1: Create the Repo on GitHub
- Go to github.com/new
- Name it
terminal-detach - Make it Public
- DO NOT initialize with README, .gitignore, or license (we already have these)
- Click Create repository
Step 2: Initialize and Push
# Navigate to the extension folder
cd terminal-detach
# Initialize git (if not already)
git init
# Add all files
git add .
# Commit
git commit -m "Initial commit: Terminal Detach extension v1.0.0"
# Add remote (replace with your actual repo URL)
git remote add origin https://github.com/AceLozabe/terminal-detach.git
# Push to main branch
git branch -M main
git push -u origin main
Step 3: Verify
Your repo should now contain:
terminal-detach/
├── .eslintrc.json
├── .gitignore
├── .vscodeignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── images/
│ ├── icon.png
│ └── icon-small.png
├── package.json
├── src/
│ ├── extension.ts
│ └── test/
│ ├── extension.test.ts
│ ├── runTest.ts
│ └── suite/
│ └── index.ts
└── tsconfig.json
License
This project is licensed under the MIT License — see the LICENSE file for details.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
Made with ❤️ by Ace Lozabe from the Philippines
Free and open source for the community 🌏
# terminal_and_debugConsole_detach