Integrated terminal
The coding workspace's integrated terminal runs shell commands in the selected working directory. It provides continuous terminal sessions, quick commands, command history, and diagnostics. Inspect terminal output separately from tool results shown in chat.
Confirm the location first
Select the project or worktree, then open the terminal. Check the active terminal, shell, and current directory. Without a valid directory, open a workspace rather than borrowing another project's terminal.
Before building, migrating, or cleaning, check pwd (Get-Location in PowerShell) and git status --short --branch. Directory and environment determine a command's scope; the chat title does not prove its location.
Choose an execution path
| Entry | Behavior |
|---|---|
| Interactive terminal | Enter commands in the active shell and inspect continuous output |
| Quick commands | Send the selected command to this workspace's active terminal |
| Custom commands | Run input in the same terminal session and record its history |
| Diagnostics | Produce a diagnostic report, separate from test or build results |
Quick entries include git status, npm test, and npm run build. They are launch shortcuts, not a requirement to use npm. Read the repository scripts before selecting checks.
Example: run project checks
Open the target project's terminal, verify its location, then read scripts in package.json. These commands apply to npm projects providing test and build scripts:
git status --short --branch
npm test
npm run build
Run commands individually and inspect each result. If tests enter watch mode, stop watching or use the repository's supported single-run option. Input entered while a previous command owns the terminal is not evidence of execution.
| Check | POSIX shell | PowerShell |
|---|---|---|
| Working directory | pwd | Get-Location |
| Previous external command's exit code | echo $? | $LASTEXITCODE |
| Interrupt foreground command | Ctrl+C | Ctrl+C |
The terminal is a persistent session. Earlier cd commands, environment variables, and virtual environments affect later input. Quick commands use this same active shell, without creating a clean environment. Inspect the exit code immediately after the target command finishes.
For a development server, retain its session and record its port. Run checks in another terminal session while the server is active. Closing a panel does not establish that the server stopped.
Establish completion
Sending a command to the terminal does not establish success. Check whether the process is still running, its exit status, full errors, and expected output. Passing tests must cover this change; a successful build must produce the intended artifact.
Manage resident services separately from one-shot commands. Quiet terminal output does not prove a background service has exited. Before interrupting a process, establish that it belongs to this task and not another project.
History, diagnostics, and secrets
History is scoped by working directory and recalls command input; it does not prove execution results. Clearing input history does not erase terminal output, logs, or external records.
Keep tokens, full environment dumps, and secret-bearing connection strings out of commands. Before sharing diagnostics, inspect paths, accounts, request content, and sensitive log fields while preserving useful errors and timing.
Troubleshoot
| Situation | Action |
|---|---|
| Command used the wrong directory | Stop further writes, establish the actual effect, then select the intended workspace |
| Command not found | Check shell, PATH, and project prerequisites instead of installing unrelated dependencies |
| No completion state | Inspect the active session and process before starting a duplicate service or migration |
| Healthy diagnostics but a failed task | Return to the actual failing command's input and output |
See Git worktrees for isolation and Code review and changes for acceptance.