Set editor working directory to be the same as the console working directory
See original GitHub issueIssue Report Checklist
- [ x] Searched the issues page for similar reports
- Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
- [ x] Reproduced the issue after updating with
conda update spyder
(orpip
, if not using Anaconda) - Could not reproduce inside
jupyter qtconsole
(if console-related) - Tried basic troubleshooting (if a bug/error)
- Restarted Spyder
- Reset preferences with
spyder --reset
- Reinstalled the latest version of Anaconda
- Tried the other applicable steps from the Troubleshooting Guide
- [ x] Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
This is a small irritation for me, but I can’t find a way to solve it. Thanks in advance for any suggestions.
I would like the editor working directory (the default save location for new .py files) to be the same as the working directory of the currently active console. Instead, the editor working directory seems to default to either my home directory or the last directory I saved a file in, which results in my regularly saving files in the wrong directory. I can’t seem to find any settings related to the editor working directory.
What I want is for the paths circled in green to be updated whenever the console working directory (red) is changed (see the image below), whether that change comes from navigation or from switching consoles.
What steps reproduce the problem?
- Save a file in the current console working directory (directory 1)
- Change the current console working directory to a new directory (directory 2)
- Open a new .py file and save.
What is the expected output? What do you see instead?
I would expect the default save directory to be (directory 2). Instead, the default save directory is (directory 1).
Paste Traceback/Error Below (if applicable)
N/A
Versions
- Spyder version: 3.3.4
- Python version: 3.6
- Qt version: 5.9.7
- PyQt version: 5.9.2
- Operating System name/version: Windows 10 Home
Dependencies
IPython >=4.0 : 7.4.0 (OK)
cython >=0.21 : 0.29.6 (OK)
jedi >=0.9.0 : 0.13.3 (OK)
matplotlib >=2.0.0: 3.0.3 (OK)
nbconvert >=4.0 : 5.4.1 (OK)
numpy >=1.7 : 1.14.5 (OK)
pandas >=0.13.1 : 0.23.4 (OK)
pycodestyle >=2.3 : 2.5.0 (OK)
pyflakes >=0.6.0 : 2.1.1 (OK)
pygments >=2.0 : 2.3.1 (OK)
pylint >=0.25 : 2.3.1 (OK)
qtconsole >=4.2.0 : 4.4.3 (OK)
rope >=0.9.4 : 0.12.0 (OK)
sphinx >=0.6.6 : 1.8.5 (OK)
sympy >=0.7.3 : 1.3 (OK)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top GitHub Comments
@Akashtyagi08 take a look at:
https://github.com/spyder-ide/spyder/blob/4.x/spyder/plugins/editor/plugin.py#L1878 and https://github.com/spyder-ide/spyder/blob/4.x/spyder/plugins/editor/plugin.py#L1926
This is not that hard to do. We’ll try to implement it for Spyder 4.