Open ikanobori opened 10 years ago
Setting this resolved, recreate if it is broken in the new frontend.
Original Comment By: Simon de Vlieger
I'd just like to +1 this issue.
I'm running bpython on Ubuntu 12.10, and the single most show-stopping bpython behavior, preventing me from using bpython as my 'default' REPL, is that when I'm at the command line, typing code, I can't press CTRL+c to break out of the currently line.
In the normal python REPL, it's really useful to do this as I find myself frequently experimenting with new things, trying different combinations, etc., and having to manually backspace across the screen takes way longer and is a quite a bit more tedious than a quick CTRL+c tap.
Original Comment By: Randall Degges
I agree that our handling of ctrl-c is somewhat different from vanilla Python (or, IOW: "broken"). Unfortunately, your patch seems to introduce some other issues. I'll try again later this day, please feel free to bump this issue if I forget about it.
Original Comment By: Andreas Stührk
I've just test the ^C
behavior using the latest code from master, and it works as expected in Python 2.7 but doesn't in Python 3.5.
See:
$ bpython
bpython version 0.17.dev55 on top of Python 2.7.12 /home/elias/.virtualenvs/bpython/bin/python
>>> d = {}
>>> d.get(
... # will hit Ctrl-C now
...
KeyboardInterrupt
>>>
In Python 3.5, I only see the result of KeyboardInterrupt after hitting Enter:
$ bpython
bpython version 0.17.dev55 on top of Python 3.5.2 /home/elias/.virtualenvs/bpython3/bin/python3
>>> d = {}
>>> d.get(
... # will hit Ctrl-C now
...
...
KeyboardInterrupt
>>>
KeyboardInterrupt
>>> # the above was result of hitting Ctrl-C three times and then hitting ENTER
I have the exact same issue as @eliasdorneles running bpython 0.16 in python 3.6.0 on OS X 10.12.5:
This will not interrupt any code execution, though. Accidentally printing a very large list, or so, will not get interrupted by Ctrl-C..
Hi, any update on this? it will be really nice if Ctrl-C acts as a KeyboardInterrupt
+1 it should interrupt code execution
I just started using bpython and I love it, however this bug is really bugging me
OS: Ubuntu 19.10
Terminal: gnome-terminal
BPython Version:
$ bpython3
bpython version 0.18 on top of Python 3.7.5 /usr/bin/python3
My cli at least doesn't do the whole keyboard-interrupt-to-clear-line thing that I've gotten so used to having. I think it's because getkey within curses catches and processes it and it actually has to be raised within the p_key function. This is all speculation since I don't know how either bpython nor curses really works. I attached a diff that fixes the problem for me but not entirely sure if this would break anything else so should be reviewed by someone that actually knows how things work :P.
In case this is system specific issue, I'm running bpython against python 2.6.1 on Mac OS X 10.6.6