VS Code: Terminal & Tasks
VS Code's integrated terminal and task runner keep you inside the editor for the full development workflow. Tasks automate common commands with keyboard shortcuts and problem matchers that highlight errors inline.
Integrated Terminal Shortcuts
# Open/toggle terminal
Ctrl+` # Toggle terminal panel
Ctrl+Shift+` # Create new terminal
Ctrl+Shift+5 # Split terminal (side by side)
# Navigate terminals
Ctrl+PageDown/PageUp # Switch to next/previous terminal
Ctrl+Alt+L # Focus terminal (even when in editor)
Alt+Left/Right # Navigate terminal history entries
# Terminal panel management
Ctrl+Shift+` # New terminal
# Drag the + to create named terminals
# Right-click tab → Rename (give terminals names like "dev server", "tests")
# Send selection to terminal
# Select code in editor → right-click → "Run in Active Terminal"
# Or: Ctrl+Shift+P → "Terminal: Run Selected Text in Active Terminal"
# Clear terminal
Ctrl+K # Clear terminal output (while terminal has focus)
# Or: type "clear" / "cls" on Windows
# Copy/paste in terminal
Ctrl+C # Copy selected text (when text is selected)
Ctrl+Shift+C # Copy (macOS: Cmd+C)
Ctrl+Shift+V # Paste
# Zoom terminal text
Ctrl+= / Ctrl+- # Increase/decrease font size
# Terminal settings
# Ctrl+Shift+P → "Terminal: Select Default Profile"
# Available profiles: bash, zsh, fish, PowerShell, Git Bash
# Split terminal for running two things simultaneously
Ctrl+Shift+5 # Split current terminal vertically
# Example: npm run dev in left, npm test in righttasks.json
Tasks in VS Code run arbitrary shell commands with keyboard shortcuts, problem matchers, and dependency chains. Create `.vscode/tasks.json`.
// .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build TypeScript",
"type": "shell",
"command": "npx tsc --noEmit",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": "$tsc"
},
{
"label": "Run Dev Server",
"type": "shell",
"command": "npm run dev",
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "dedicated"
},
"problemMatcher": {
"pattern": {
"regexp": "^(ERROR|WARNING)\\s+in\\s+(.+):(\\d+):(\\d+)$",
"severity": 1,
"file": 2,
"line": 3,
"column": 4
},
"background": {
"activeOnStart": true,
"beginsPattern": "Starting\\.\\.\\.\",
"endsPattern": "ready in"
}
}
},
{
"label": "Run Tests with Watch",
"type": "shell",
"command": "npx jest --watch --passWithNoTests",
"isBackground": true,
"problemMatcher": "$jest-watch"
},
{
"label": "Full Check (type + lint + test)",
"dependsOn": ["Build TypeScript", "Lint", "Run Tests"],
"dependsOrder": "parallel",
"group": "build"
}
]
}Terminal Profiles & Environment
// settings.json - terminal configuration
{
// Default shell profile
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.defaultProfile.windows": "Git Bash",
// Custom named profiles
"terminal.integrated.profiles.osx": {
"zsh": {
"path": "/bin/zsh",
"args": ["-l"],
"icon": "terminal-bash"
},
"node-dev": {
"path": "/bin/zsh",
"env": {
"NODE_ENV": "development",
"DATABASE_URL": "postgresql://localhost/myapp_dev"
},
"icon": "symbol-event"
}
},
// Font and appearance
"terminal.integrated.fontFamily": "'MesloLGS NF', monospace",
"terminal.integrated.fontSize": 13,
"terminal.integrated.lineHeight": 1.2,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.cursorBlinking": true,
// Behavior
"terminal.integrated.scrollback": 10000,
"terminal.integrated.persistentSessionSupport": true,
"terminal.integrated.enableImages": true,
// Env vars for all integrated terminals
"terminal.integrated.env.osx": {
"EDITOR": "code --wait"
}
}Running & Debugging Tasks
# Running tasks
Ctrl+Shift+B # Run default build task
Ctrl+Shift+P → "Tasks: Run Task" # Pick any task
Ctrl+Shift+P → "Tasks: Run Build Task"
Ctrl+Shift+P → "Tasks: Run Test Task"
# After running a task:
# Errors are shown in the Problems panel (Ctrl+Shift+M)
# Click any error → jumps to the file + line
# Problem matcher parses compiler/linter output into Problems panel
# Common problem matchers:
# "$tsc" TypeScript compiler
# "$tsc-watch" TypeScript watch mode
# "$eslint-stylish" ESLint stylish output
# "$jest-watch" Jest watch mode
# "$go" Go compiler
# "$rust" Rust/Cargo compiler
# Binding a task to a keyboard shortcut (keybindings.json)
[
{
"key": "ctrl+shift+t",
"command": "workbench.action.tasks.runTask",
"args": "Run Tests with Watch"
},
{
"key": "ctrl+shift+b",
"command": "workbench.action.tasks.runTask",
"args": "Build TypeScript"
}
]
# launch.json: debug config (separate from tasks)
# Ctrl+Shift+D → create launch.json
# Run & Debug panel → play button
# F5 = start debugging, F9 = toggle breakpoint
# F10 = step over, F11 = step into, Shift+F11 = step outKeep your own version of these notes — editable, searchable, and organised by your stack.
Start free