Auto Terminal on Startup

A simple VS Code extension that automatically opens a terminal in the editor area when VS Code starts without a folder.
Features
- Automatically opens a terminal when VS Code launches without a workspace/folder
- Terminal opens in the editor area (based on your
terminal.integrated.defaultLocation
setting)
- Configurable: Can be enabled/disabled via settings
- Option to control whether it only opens when no folder is present
Requirements
- VS Code 1.84.0 or higher
- Your VS Code settings should have:
"terminal.integrated.defaultLocation": "editor"
Installation
Install from the VS Code Marketplace:
- Open VS Code
- Go to Extensions view (
Cmd+Shift+X
or Ctrl+Shift+X
)
- Search for "Auto Terminal on Startup"
- Click Install
Or install via command line:
code --install-extension lixiaolai.auto-terminal-on-startup
Or visit the VS Code Marketplace
Extension Settings
This extension contributes the following settings:
autoTerminal.enabled
: Enable/disable the auto-open terminal feature (default: true
)
autoTerminal.onlyWhenNoFolder
: Only open terminal when no folder is open (default: true
)
To configure, add to your settings.json
:
{
"autoTerminal.enabled": true,
"autoTerminal.onlyWhenNoFolder": true
}
How It Works
- Extension activates on
onStartupFinished
event
- Checks if no folder/workspace is open (if
onlyWhenNoFolder
is true)
- Waits 500ms for VS Code UI to fully initialize
- Executes
workbench.action.terminal.new
command
- Terminal opens in editor area (based on your
terminal.integrated.defaultLocation
setting)
Troubleshooting
Terminal opens in panel instead of editor area
Make sure your VS Code settings include:
{
"terminal.integrated.defaultLocation": "editor"
}
Terminal doesn't open automatically
Check that the extension is enabled:
- Press
Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux)
- Type "Extensions: Show Installed Extensions"
- Look for "Auto Terminal on Startup"
Check the extension settings:
{
"autoTerminal.enabled": true
}
Check the Developer Console for errors:
- Help > Toggle Developer Tools
- Look in Console tab for any error messages
Disable the extension temporarily
Set in your settings.json
:
{
"autoTerminal.enabled": false
}
Or disable the extension completely:
- Press
Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux)
- Type "Extensions: Disable"
- Select "Auto Terminal on Startup"
Uninstallation
Via VS Code:
- Go to Extensions view (
Cmd+Shift+X
or Ctrl+Shift+X
)
- Find "Auto Terminal on Startup"
- Click Uninstall
Or via command line:
code --uninstall-extension lixiaolai.auto-terminal-on-startup
Development
Building from Source
cd /path/to/open-terminal-at-vscode-without-folder-specified
npm install -g @vscode/vsce
vsce package
Testing
- Press
F5
in VS Code to open Extension Development Host
- Close all folders/workspaces
- Terminal should open automatically in editor area
Known Issues
- The extension cannot detect if a terminal already exists in the editor area, so it will always create a new one on startup
- 500ms delay is hardcoded (may need adjustment for slower systems)
Release Notes
1.0.0
Initial release:
- Auto-open terminal in editor area on VS Code startup
- Configurable via settings
- Only opens when no folder is present (optional)
License
MIT
Author
Xiaolai