-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-102628: Fix sqlite3 CLI promt text on Windows #103898
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
Conversation
CTRL-Z is the Windows equivalent of CTRL-D.
@terryjreedy, will this work on IDLE on Windows, or does that only support CTRL-D? |
First, note that ^Z by itself does not work, which is confusing to *nix users who just learn 'Use ^Z instead of ^D". So maybe it should say "^Z + " or perhaps "^Z in a Windows console". But experienced Windows users 'should' know about -- although I managed to forget occasionally from disuse. What do you think? Currently, IDLE only supports ^D, which is why I have not done this yet. About a decade ago, someone decided that IDLE should work same across platforms. Because of this issue, I was thinking maybe ^Z should have been left if possible. I don't know if we can make ^D work in CommandPrompt. I suspect not. The current PR is an improvement, so merge if you want, or with either alternative. |
Is there a stable way to detect if we are running in IDLE? I've seen people check if |
I landing this, as it is an improvement over the current prompt. I'm slightly reluctant to expanding the prompt as hinted, since I think it is preferable to keep it as succinct as possible. I still think we should try to fix the IDLE-on-Windows case, though. |
Thanks for the insight, @terryjreedy. Thanks for the report, @Dutcho |
You merged after I decided to make the 'hack' official and wrote the following. Please do the followup or ask me to. Good question. At least some people are checking But what about when one starts IDLE with '-n' (no subprocess). This is 'deprecated' and not actively maintained and tested. (However, it has no removal date and I might reverse this.) It happens that other modules currently import common items from run, but these should be moved to util. To avoid breaking what I have suggested, I added a note to my draft issue for populating util that if run imports are removed, 'idlelib.run' must still be added to sys.modules. I should say something in the IDLE doc too. |
I merged, since you said:
Sorry if I misunderstood. Also, I do plan to follow up this; I'll request your review. If the |
For the record, the follow-up PR is here: |
No misunderstanding. Your question really was a good one. It is one thing to say on SO "Here's a hack that works now" and another to use it in the stdlib. So I reviewed the code to make sure I understood why it works. It turned out that the answer is completely different for the 2 different execution modes. Having it always work is trivial. pyshell already manipulates sys.modules for another back-compatibility issue. |
CTRL-Z is the Windows equivalent of CTRL-D.