From ffb87905cb3883c84598b87ca05384c17d59dee1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 27 Feb 2014 13:26:22 -0700 Subject: sandbox: Allow Ctrl-C to work in sandbox It is useful for Cltl-C to be handled by U-Boot as it is on other boards. But it is also useful to be able to terminate U-Boot with Ctrl-C. Add an option to enable signals while in raw mode, and make this the default. Add an option to leave the terminal cooked, which is useful for redirecting output. Signed-off-by: Simon Glass --- drivers/serial/sandbox.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index c27b5b8fe5..51fd871dff 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -15,6 +15,7 @@ #include #include #include +#include /* * @@ -31,7 +32,10 @@ static unsigned int serial_buf_read; static int sandbox_serial_init(void) { - os_tty_raw(0); + struct sandbox_state *state = state_get_current(); + + if (state->term_raw != STATE_TERM_COOKED) + os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS); return 0; } -- cgit v1.2.1