In raw mode, handle ctrl-c as normal. This allows normal ctrl-c behavior
such as aborting a command that is timing out without completely
terminating the sandbox executable.
In [1], Simon disabled this. His reason for it was that it interferes
with piping test scripts. Piping should be done in cooked mode, so this
change should still not interfere.
[1] commit
8969ea3e9f2db04a6b3675 ("sandbox: Disable Ctrl-C")
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
static int ctrlc_was_pressed = 0;
int ctrlc(void)
{
-#ifndef CONFIG_SANDBOX
if (!ctrlc_disabled && gd->have_console) {
if (tstc()) {
switch (getc()) {
}
}
}
-#endif
return 0;
}
*/
#include <common.h>
+#include <console.h>
#include <dm.h>
#include <fdtdec.h>
#include <lcd.h>
os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS);
priv->start_of_line = 0;
+ if (state->term_raw != STATE_TERM_RAW)
+ disable_ctrlc(1);
+
return 0;
}