Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed Python with the Windows binaries, so I need to type python -i to start Python in Cygwin. And when I exit it I need to write exit(). It is just a minor issue, but I still would like to know if it possible to fix it so I can exit using Ctrl+Z like I do when I run Python in cmd

share|improve this question
Try using Ctrl-D to exit instead. –  MattDMo Mar 29 '13 at 1:05
Already tried it, and it does not work either –  starcorn Mar 29 '13 at 1:43

1 Answer 1

The problem here is the difference between Cygwin terminal emulators (MinTTY etc), which try to act like Linux terminals for the benefit of native Cygwin apps, and the Windows cmd terminal emulator. Because MinTTY handles signals differently, it won't pass Ctrl+Z as an EOF signal to Windows Python, while Ctrl+D isn't handled by Windows Python at all.

The solution is to stick to using Windows Python in Windows terminal emulators (ie the cmd terminal emulator, which is the same one as you get if you start Windows Python from the Start Menu or similar), and to install Cygwin Python and use that from Cygwin terminal emulators. That way each will receive and handle the relevant signals correctly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.