Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e9751d2a
Commit
e9751d2a
authored
Dec 22, 2015
by
Damien George
Browse files
unix: Properly cancel REPL input when Ctrl-C is pressed.
parent
401af50d
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/main.c
View file @
e9751d2a
...
...
@@ -176,7 +176,11 @@ STATIC int do_repl(void) {
int
ret
=
readline
(
&
line
,
">>> "
);
mp_parse_input_kind_t
parse_input_kind
=
MP_PARSE_SINGLE_INPUT
;
if
(
ret
==
CHAR_CTRL_D
)
{
if
(
ret
==
CHAR_CTRL_C
)
{
// cancel input
mp_hal_stdout_tx_str
(
"
\r\n
"
);
goto
input_restart
;
}
else
if
(
ret
==
CHAR_CTRL_D
)
{
// EOF
printf
(
"
\n
"
);
mp_hal_stdio_mode_orig
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment