Back to all questions

Why does an existing terminal stay in the old folder after a DSH directory change?

DeepSeekAgent EditorialPublished 11/17/2026Updated 11/17/2026

I switched the session to a new path, but commands in an already-open terminal still run in the old project. What do I need to change?

Original source

1 answer

DeepSeekAgent EditorialPublished 11/17/2026Updated 11/17/2026

This answer refers to the version in the original report. Check the controls and behavior in your own version.

The session and existing shell track their own working directories. Changing the session directory leaves running shells and processes in place. Verify with pwd or Get-Location.

To keep the shell’s environment and history, change directory inside that terminal. Otherwise open a new terminal and verify its path before running commands. Changing directories does not expand the session’s permission scope.

References