4 ms·
sounds like python which don't accept ctrl + c and says you to do ctrl + d or something (i don't know python)
by cute_boi 5y ago
sounds like python which don't accept ctrl + c and says you to do ctrl + d or something (i don't know python)
- klodolph 5y agoctrl + c is accepted, it means "interrupt the current operation", like it does if you are in bash. If there's no current operation, Python has no way of knowing for sure if you intended to exit, or if you intended to interrupt an operation, but the operation finished before you pressed the key combo. Python's behavior here is good UX. A key combo that does two different things depending on the current state of the program, and the program's state is changing right in front of you... that would suck.
- Freak_NL 5y agoUsing Ctrl + D to exit a shell and Ctrl + C to interrupt/break off the current line is a rather strong convention. Bash does this too, and many other REPL's and shells (Ruby's irb for one). A lot of technical folk who rely on this immediately notice when some shell doesn't do this (exiting instead of breaking of the current input line). I have this with Hbase's hbase shell. I've dropped out of that by accident dozens of times because Ctrl + C interrupts the whole shell.
- xrisk 5y agoFWIW, Ctrl+D is not "magic". It works because Ctrl+D is EOF. Applications that read input should expect that the input is done when they encounter EOF.
- tpxl 5y agoI like this feature because I'll use ctrl+C to cancel the current line I'm writing like I would in a terminal. Psql does the same thing, but I started using mysql recently and I keep getting booted out of the app because I want to cancel the current line ):