msg198393 - (view) |
Author: anatoly techtonik (techtonik) |
Date: 2013-09-25 16:32 |
Ctrl-D shortcut works to terminate session in Python 2 on Windows, and doesn't work with Python 3. |
|
|
msg198394 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2013-09-25 16:45 |
It never worked for me. Are you using a custom shell or cygwin or something? |
|
|
msg198395 - (view) |
Author: Ethan Furman (ethan.furman) *  |
Date: 2013-09-25 16:45 |
Ctrl-D has never work for me on Windows either. |
|
|
msg198396 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-09-25 16:48 |
It doesn't work on Python 2.x either as delivered. Usually means you have an external readline module installed. |
|
|
msg198397 - (view) |
Author: anatoly techtonik (techtonik) |
Date: 2013-09-25 16:52 |
Well, it appears that installed IPython brought pyreadline, but I execute it in standard Python shell. I'd vote for this feature by default. Is that possible without readline? |
|
|
msg198398 - (view) |
Author: anatoly techtonik (techtonik) |
Date: 2013-09-25 16:52 |
Here is the output of "py -v". |
|
|
msg198399 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2013-09-25 17:08 |
The Windows (and before it MS-DOS) EOF character is Ctrl-Z. Try that. Depending on the toolset you use, it might use Ctrl-D as EOF. Cygwin's python uses Ctrl-D. |
|
|
msg198400 - (view) |
Author: anatoly techtonik (techtonik) |
Date: 2013-09-25 17:17 |
It would be nice if Python supported some cross-platform standard for user interfaces. It is rather annoying to use Ctrl-Z for Python in local window and Ctrl-D for Python in remote console session (which is *nix of course). It becomes even more annoying, because Ctrl-Z in *nix session sends Python process to background. |
|
|
msg198401 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2013-09-25 17:22 |
It's trying to be consistent on whatever platform it's on. I'd rather python.exe match all other text-based .exe's on Windows. We can't have it both ways. But I agree it's a hassle. Cross-platform is a problem that Cygwin is trying to solve, so I suggest you use it. I usually use the Cygwin python for this reason. |
|
|
msg198402 - (view) |
Author: Brian Curtin (brian.curtin) *  |
Date: 2013-09-25 17:25 |
I'm unable to find the previous issue, but you asked for this in the past. Ctrl-Z and Ctrl-D simply have different meanings on the different platforms, outside of what Python does. We already can't make Ctrl-Z on Windows do what it does on Linux, and Ctrl-D is not natural to Windows users. |
|
|
msg198403 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-09-25 17:32 |
I'm at best +0.25, but I don't have a problem with Ctrl-D exiting on Windows, as it doesn't do anything else! The thing is, though, that this is all handled within myreadline.c:my_fgets which is a call into the system fgets which errors out with Ctrl-Z but returns Ctrl-D. Which means that the two would behave differently even if we special-cased Ctrl-D. (Sorry: was that explanation a bit involved?) |
|
|
msg198495 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2013-09-27 18:22 |
[Brain Curtin] > Ctrl-Z and Ctrl-D simply have different meanings > on the different platforms, outside of what Python does. > We already can't make Ctrl-Z on Windows do what it does > on Linux, and Ctrl-D is not natural to Windows users. I concur. It would be a mistake to violate the O/S standards and norms. I recommend this issue be closed. |
|
|
msg198496 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2013-09-27 18:32 |
Closing as rejected. |
|
|