Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Auto PathNew to Visual Studio Code? Get it now.
Auto Path

Auto Path

Haig Emirzian

| (0) | Free
Automatically syncs the active integrated terminal CWD to the active editor file's directory.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto Path

Automatically changes the integrated terminal's working directory to match the active editor file.

How it works

When you switch to a file in a different directory, Auto Path runs a cd in the active terminal. When shell integration is available, it uses VS Code's execute command API so the command is typically not echoed. If shell integration is unavailable (for example, Command Prompt), it falls back to sendText and the command may appear.

Example:

Project structure:

project/
	src/index.ts
	tests/utils.test.ts

Before switching files:

Active editor: src/index.ts
Terminal: $ ~/project/src

After switching to tests/utils.test.ts:

Active editor: tests/utils.test.ts
Terminal: $ ~/project/tests

Settings

Setting Default Description
autoPath.enabled true Enable or disable automatic directory sync
autoPath.shell auto Override detected shell (cmd, pwsh, gitbash, bash, sh, zsh)

Toggle it in VS Code settings (Ctrl+,) by searching autoPath.

Notes

  • Only works with real files (not untitled tabs, Settings, etc.)
  • Requires an open integrated terminal to sync to
  • Detects the active terminal shell when possible; set autoPath.shell if detection is wrong or unavailable
  • Uses shell integration when available to reduce command echoing; otherwise the command may appear
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft