Skip to content

Automatically sync Terminal CWD when switching Repository #912

@tuanlinhvq97

Description

@tuanlinhvq97

I work with multiple repositories in a multi-root workspace. When I switch between repositories using the dropdown menu in the Git Graph view, the VS Code Integrated Terminal remains in the previous directory.

It is frustrating to manually type cd <path> or switch terminals every time I change the context in Git Graph to run git commands or scripts for that specific repo.

Describe the solution you'd like
I would like to request a new setting (e.g., git-graph.terminal.autoChangeDirectory).

When this setting is enabled:

  1. Selecting a repository from the Git Graph dropdown menu triggers an event.
  2. The extension automatically sends a command to the currently active terminal to change the directory to the selected repository's root path.
    • Example implementation logic: vscode.window.activeTerminal.sendText("cd " + repoPath)

Describe alternatives you've considered

  • Using the "Terminal Here" extension to open a new terminal manually.
  • Creating multiple dedicated terminals for each repo and switching them manually.
  • Both methods add friction to the workflow compared to having the terminal follow the Git Graph context automatically.

Additional context
This feature would greatly enhance the workflow for users managing microservices or multi-repo projects.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions