microsoft / microsoft/vscode-python-environments
python.terminal.executeInFileDir no longer uses "cd" to switch the working directory
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 138
- フォーク
- 62
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 35
説明
Type: Bug
Behaviour
With previous versions of vs code, whenever I ran a python file in a terminal, there clearly was a "cd" command running, which changed the working directory to the files' directory, when python.terminal.executeInFileDir was enabled.
Now, when I run a file and a new terminal gets launched, it correctly opens in the selected files' directory. However, when I manually cd into a different dir and try to re-run the script, the working directory is no longer changed
Steps to reproduce:
- Run a python file
- Manually switch to a different folder with cd
- Run the same python file again
- The working directory stays at the one manually switched to.
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2026-04-24 09:25:11.139 [debug] Delay Trigger[Test Configuration Change]: triggered=164, called=25
2026-04-24 09:25:13.518 [debug] Attempting to run Python file undefined
2026-04-24 09:25:17.229 [debug] Received shell integration sequence for bash
2026-04-24 09:25:17.505 [debug] Extension unknown accessed getActiveEnvironmentPath with args: undefined
2026-04-24 09:25:17.505 [debug] Extension unknown accessed resolveEnvironment with args: {"id":"/p/tv/local/miniforge/miniforge_blauths/envs/cashocs/bin/python","path":"/p/tv/local/miniforge/miniforge_blauths/envs/cashocs/bin/python"}
2026-04-24 09:25:17.899 [debug] Delay Trigger[Test Configuration Change]: triggered=169, called=26
2026-04-24 09:25:21.410 [debug] Received shell integration sequence for bash
2026-04-24 09:25:25.309 [debug] Received shell integration sequence for bash
2026-04-24 09:25:25.334 [debug] Extension unknown accessed getActiveEnvironmentPath with args: undefined
2026-04-24 09:25:25.334 [debug] Extension unknown accessed resolveEnvironment with args: {"id":"/p/tv/local/miniforge/miniforge_blauths/envs/cashocs/bin/python","path":"/p/tv/local/miniforge/miniforge_blauths/envs/cashocs/bin/python"}
2026-04-24 09:25:29.945 [debug] Received shell integration sequence for bash
2026-04-24 09:25:35.859 [debug] Received shell integration sequence for bash
2026-04-24 09:25:49.842 [debug] Received shell integration sequence for bash
2026-04-24 09:26:18.362 [debug] Attempting to run Python file undefined
2026-04-24 09:26:19.141 [debug] Delay Trigger[Test Configuration Change]: triggered=174, called=27
2026-04-24 09:26:22.736 [debug] Received shell integration sequence for bash
2026-04-24 09:26:27.494 [debug] Received shell integration sequence for bash
Extension version: 2026.4.0
VS Code version: Code 1.117.0 (10c8e557c8b9f9ed0a87f61f1c9a44bde731c409, 2026-04-21T16:12:14-07:00)
OS version: Linux x64 5.14.0-611.49.1.el9_7.x86_64
Modes:
- Python version (& distribution if applicable, e.g. Anaconda): 3.13.13.final.0
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
- Value of the
python.languageServersetting: Default
User Settings
Multiroot scenario, following user settings may not apply:
condaPath: "<placeholder>"
languageServer: "Pylance"
testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• autoTestDiscoverOnSaveEnabled: false
terminal
• executeInFileDir: "<placeholder>"
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| autodocstring | njp | 0.6.1 |
| copilot-chat | Git | 0.45.1 |
| debugpy | ms- | 2025.18.0 |
| even-better-toml | tam | 0.21.2 |
| gitlab-workflow | Git | 6.75.1 |
| isort | ms- | 2025.0.0 |
| js-debug-companion | ms- | 1.1.3 |
| jsts-chat-features | Typ | 0.0.2 |
| path-intellisense | chr | 2.10.0 |
| python | ms- | 2026.4.0 |
| ruff | cha | 2026.40.0 |
| vscode-icons | vsc | 12.18.0 |
| vscode-js-profile-table | ms- | 1.0.10 |
| vscode-pull-request-github | Git | 0.138.0 |
| vscode-pylance | ms- | 2026.2.1 |
| vscode-python-envs | ms- | 1.29.2026042301 |
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。