8000 Ctrl+C on non-empty line acts like Enter instead of Cancel/Escape · Issue #1742 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Ctrl+C on non-empty line acts like Enter instead of Cancel/Escape #1742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pfalcon opened this issue Dec 22, 2015 · 2 comments
Closed

Ctrl+C on non-empty line acts like Enter instead of Cancel/Escape #1742

pfalcon opened this issue Dec 22, 2015 · 2 comments

Comments

@pfalcon
Copy link
Contributor
pfalcon commented Dec 22, 2015

As reported by @pohmelie at #1733 (comment) :

Also, if I try ctrl-c in repl it looks like it actually do enter, even on unix build.

$ ./micropython
MicroPython v1.4.5-654-g37f414f on 2015-12-21; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>> 
>> 
>> fooTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'foo' is not defined
>> 
@dpgeorge
Copy link
Member

Ok, this particular issue fixed in e9751d2. [stmhal is ok, since lib/utils/pyexec already had the check for ctrl-c.]

Note that not printing "KeyboardInterrupt" on ctrl-C at the REPL (as per CPython) is by design (rightly or wrongly). The REPL is not executed within an nlr protection block and so shouldn't raise any exceptions (only executed code is nlr protected).

@pfalcon
Copy link
Contributor Author
pfalcon commented Dec 22, 2015

Thanks for quick fix!

Note that not printing "KeyboardInterrupt" on ctrl-C at the REPL (as per CPython) is by design (rightly or wrongly).

Yep, I figure that, that's why I didn't raise that as an issue, and as nobody else did either, I hope everyone agrees it makes sense. For me, not printing extra line is aesthetically cleaner, kind of like bash handles ctrl+c.

@pfalcon pfalcon closed this as completed Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0