1

When I open a python shell in PowerShell, I cannot close it using Ctrl+c, Ctrl+z, or Ctrl+d. I swore it worked before, it works in VS Code's terminal as well, so I'm not quite sure what is wrong with powershell. The only way to exit is using the quit() function.

When I do Ctrl+c, I get

KeyboardInterrupt

Ctrl+d gets me

^d

and likewise for Ctrl+z

Info:

  • Windows 10

  • python 3.8.0

Lucan
  • 2,907
  • 2
  • 16
  • 30
Andrew
  • 1,238
  • 3
  • 13
  • 28

1 Answers1

2

According to this answer, eof on Windows is different from *nix.

It is Crtl + z on Windows that gives you end of file, not Crtl + d.

Therefore, press Crtl + z and enter should do the trick.

ph3rin
  • 4,426
  • 1
  • 18
  • 42