From 01dc6b968aa1bfa9deea9917b3b45b89c80f6a24 Mon Sep 17 00:00:00 2001 From: Chris Luke Date: Sun, 10 Jun 2018 13:42:45 -0400 Subject: [PATCH] cli: Disable XON/XOFF in the tty - CLI history forward-search is bound to ^S which is common, but that is also the tty's default control byte to pause output. So we disable XON/XOFF in the tty so that we can use ^S. Change-Id: I61717c77a11733d64eed7f8119677e7cd2e20029 Signed-off-by: Chris Luke --- src/vlib/unix/cli.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c index 6c49d80aabd..727b9544854 100644 --- a/src/vlib/unix/cli.c +++ b/src/vlib/unix/cli.c @@ -2927,8 +2927,12 @@ unix_cli_config (vlib_main_t * vm, unformat_input_t * input) tio = um->tio_stdin; /* echo off, canonical mode off, ext'd input processing off */ tio.c_lflag &= ~(ECHO | ICANON | IEXTEN); + /* disable XON/XOFF, so ^S invokes the history search */ + tio.c_iflag &= ~(IXON | IXOFF); tio.c_cc[VMIN] = 1; /* 1 byte at a time */ tio.c_cc[VTIME] = 0; /* no timer */ + tio.c_cc[VSTOP] = _POSIX_VDISABLE; /* not ^S */ + tio.c_cc[VSTART] = _POSIX_VDISABLE; /* not ^Q */ tcsetattr (STDIN_FILENO, TCSAFLUSH, &tio); /* See if we can do ANSI/VT100 output */ -- 2.16.6