-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
IDLE: no Shell menu item in single-process mode #112936
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
Comments
Hello, if use_subprocess:
ms = self.menu_specs
if ms[2][0] != "shell":
ms.insert(2, ("shell", "She_ll")) Would it be feasible to simply remove the Thank you! |
@terryjreedy, I dug through past code to find the cause of the issue and tried to fix it, and I'll create a PR in a while. |
First of all, I found out that this issue was artificially introduced, which was brought up by kbkaiser in a commit 21 years ago (8f570a7): And the changes are as follows:
The key lies in the second point. And it's IMPORTANT to note that at that time there were only two options for the menu "shell": After testing, these two functions are not available when using the parameter "-n" and cause some errors. So I'm guessing that's why kbkaiser disabled the menu "shell" at that time. But from the image above, we can clearly see that more features have been added to the menu "shell" since then. After testing, the rest of the functions work correctly when using the parameter "-n". So I think the appropriate fix would be to restore the menu "shell" while disabling the two previously mentioned options that can't be used when using the "-n" parameter. The final effect is as follows: ![]() Maybe there is some problem with my idea, if there is, please help me point it out, thanks! |
The basic idea is like that, but I'm not very clear as to why those two features cause errors in single-process mode. Perhaps we should address this issue in detail in the documentation? |
In single process mode, the GUI and the user program are ran in the same process. What are you going to restart? |
Yes! It makes so much sense, how I didn't think of this question! |
…ythonGH-126598) (cherry picked from commit 7e7e49be78e26d0a3b861a04bbec1635aabb71b9) Co-authored-by: Zhikang Yan <2951256653@qq.com>
…GH-126598) (GH-133310) (cherry picked from commit 7e7e49b) Co-authored-by: Zhikang Yan <2951256653@qq.com>
Thank you all for the research, fix, and merge. I somehow missed the posting of the PR. I added 2 draft follow-up issues to the Restart topic of the IDLE issues Project page.
|
The user code shares the environment (e.g. imported modules, |
Start IDLE with
python -m idlelib -n
and the Shell menu is missing 'Shell'.-n mode is semi-deprecated, but this is egregious and should be easily fixed.
Linked PRs
The text was updated successfully, but these errors were encountered: