Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The current file cannot be closed because it is in debug mode. #13189

Closed
10 tasks
impact27 opened this issue Jul 4, 2020 · 8 comments
Closed
10 tasks

The current file cannot be closed because it is in debug mode. #13189

impact27 opened this issue Jul 4, 2020 · 8 comments

Comments

@impact27
Copy link
Contributor

impact27 commented Jul 4, 2020

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, 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
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When trying to close a file, The file doesn't close, and the following message appears:
The current file cannot be closed because it is in debug mode.

But I am not debugging. Even if I was, I find it annoying to not be allowed to close a file if I want to.

What steps reproduce the problem?

I am not sure, I will update if I find a way.

What is the expected output? What do you see instead?

I expect the file to close when I press the cross.

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version: master
  • Python version: 3.7
  • Qt version:
  • PyQt version:
  • Operating System name/version: macOS

Dependencies

PASTE DEPENDENCIES HERE
@impact27
Copy link
Contributor Author

impact27 commented Jul 4, 2020

@dalthviz what is the rationale behind preventing a file from closing? I think this was introduced in PR #10610. If I close the file I can always come back with w.

@impact27
Copy link
Contributor Author

impact27 commented Jul 4, 2020

PS: with PR #13190, you can always go to the current position

@dalthviz
Copy link
Member

dalthviz commented Jul 4, 2020

Hi @impact27 I guess we did this to be more clear about the state of the file, something like "hey, this file is being debugged" (maybe @ccordoba12 can give some more reasons about the new behavior).

However, seems like this is affecting any file instead of just the one that is actually being debugged, so we need to at least fix that (I could give it a check).

Also, taking into account your feedback, actually such behavior could feel kind of intrusive for some users so should we maybe leave it as an optional feature?

@impact27
Copy link
Contributor Author

impact27 commented Jul 5, 2020

However, seems like this is affecting any file instead of just the one that is actually being debugged, so we need to at least fix that (I could give it a check).

I will try to replicate this behaviour, I think I used post mortem

Also, taking into account your feedback, actually such behavior could feel kind of intrusive for some users so should we maybe leave it as an optional feature?

I think this is a great suggestion. What do you think the default should be?

@dalthviz
Copy link
Member

dalthviz commented Jul 5, 2020

I will try to replicate this behaviour, I think I used post mortem

Awesome, thanks for the help @impact27 !

I think this is a great suggestion. What do you think the default should be?

Probably the default could be showing the message indicating that the file is being debugged (and also informing there how to change the behavior in the preferences if needed). What do you thing @ccordoba12 ?

@ccordoba12
Copy link
Member

and also informing there how to change the behavior in the preferences if needed

I really don't think we should add an option in Preferences for this. If you want to close the file, you simply need to stop debugging it. That way the user removes the connection between the debugging console and that file, so they can use it for other purposes.

I decided to do things like that because users can have the same file being debugged in different consoles, and being located in different lines in each of them. So when they move to one of those consoles, Spyder will correctly update the blue arrow that indicates the line Pdb is placed in.

This is a UX problem most other IDEs don't have (because they use a single console), but I think it's important to maintain the current design in our case.

@impact27
Copy link
Contributor Author

impact27 commented Jul 6, 2020

I really don't think we should add an option in Preferences for this. If you want to close the file, you simply need to stop debugging it. That way the user removes the connection between the debugging console and that file, so they can use it for other purposes.

I would rather have the file close and the debugging continue. If you want to have the file and the debugging linked, then a better solution in my opinion would be to have a pop-up windows saying: "Closing this file will stop the debugging, are you sure you want to continue?"

I decided to do things like that because users can have the same file being debugged in different consoles, and being located in different lines in each of them. So when they move to one of those consoles, Spyder will correctly update the blue arrow that indicates the line Pdb is placed in.

You can simply reopen the file when the console changes, which is what already happens if you allow for closing the file.

This is a UX problem most other IDEs don't have (because they use a single console), but I think it's important to maintain the current design in our case.

In my case, the problem I have is that I only need to infrequently check on the file, and that I tend to leave the console open while debugging. It is nice to have the file open but not necessary. It can be frustrating to try to close a file and be told no without a good reason. If closing the file would create a loss of data it makes sense to ask if the file should be closed first. But in this case I want to close the file and I am being told no in a discreet way in the console. I am not necessarily looking at the console when working with the editor.

So my point of view is that If I am primarily using the console for debugging, having the file open in the editor is a nice to have, but preventing me from closing it is very frustrating. I don't see a good reason for preventing me from closing it even if I am debugging it.

@impact27
Copy link
Contributor Author

Closed in #12134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants