In this specific corner-case setup, ioctl (0, TIOCGWINSZ) returns
window height = 0 and width = 0. Rather than declaring the terminal to
be non-interactive, set the window size parameters to 80 x 24.
Change-Id: If66f5f0883f1940518ec1c6e26228c9bb6f32852
Signed-off-by: Dave Barach <dave@barachs.net>
cf->height = ws.ws_row;
if (cf->width == 0 || cf->height == 0)
- /* We have a tty, but no size. Stick to line mode. */
- goto notty;
+ {
+ /*
+ * We have a tty, but no size. Use defaults.
+ * vpp "unix interactive" inside emacs + gdb ends up here.
+ */
+ cf->width = 80;
+ cf->height = 24;
+ }
/* Setup the history */
cf->history_limit = um->cli_history_limit;
}
else
{
- notty:
/* No tty, so make sure the session doesn't have tty-like features */
unix_cli_set_session_noninteractive (cf);
}