Describe the Bug
The edit_file
and run_terminal_cmd
tools maintain separate working directory contexts, leading to inconsistent file operations. When a user changes directory using run_terminal_cmd
with cd
, the edit_file
tool continues to operate from the original working directory, not the current terminal directory. This causes files to be created/edited in unexpected locations.
Specific Issue:
run_terminal_cmd
maintains its own working directory state that can be changed viacd
commandsedit_file
tool uses an independent path resolution system that ignores the terminal’s current working directory- Users expect both tools to operate from the same working directory context
- This leads to files being created in the wrong directories when using relative pathsSpecific Issue:
run_terminal_cmd maintains its own working directory state that can be changed via cd commands
edit_file tool uses an independent path resolution system that ignores the terminal’s current working directory
Users expect both tools to operate from the same working directory context
This leads to files being created in the wrong directories when using relative paths
Steps to Reproduce
- Start in workspace directory:
/workspace/project-root/
- Use
run_terminal_cmd
to create a subdirectory:mkdir subproject
- Use
run_terminal_cmd
to change directory:cd subproject
- Verify terminal is in correct directory:
pwd # Shows: /workspace/project-root/subproject/
- Use
edit_file
to create a file with relative path:edit_file(target_file="config.txt", ...)
Actual Result: File is created at /workspace/project-root/config.txt
(original directory)
Expected Result: File should be created at /workspace/project-root/subproject/config.txt
(current terminal directory)
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.0.0 (user setup)
VSCode Version: 1.96.2
Commit: 53b99ce608cba35127ae3a050c1738a959750860
Date: 2025-06-04T19:44:25.253Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045