Merge remote-tracking branch 'lenormf/fix-ncurses'

This commit is contained in:
Maxime Coste 2018-04-01 14:42:44 +11:00
commit ff073bcce1

View File

@ -475,10 +475,13 @@ void NCursesUI::check_resize(bool force)
resize_pending = 0; resize_pending = 0;
const int fd = open("/dev/tty", O_RDWR); const int fd = open("/dev/tty", O_RDWR);
auto close_fd = on_scope_end([fd]{ close(fd); }); auto close_fd = on_scope_end([fd]{ ::close(fd); });
winsize ws; winsize ws;
if (ioctl(fd, TIOCGWINSZ, (void*)&ws) == 0)
{ kak_assert(fd > -1);
if (::ioctl(fd, TIOCGWINSZ, &ws) != 0)
kak_assert(false);
const bool info = (bool)m_info; const bool info = (bool)m_info;
const bool menu = (bool)m_menu; const bool menu = (bool)m_menu;
if (m_window) delwin(m_window); if (m_window) delwin(m_window);
@ -504,9 +507,6 @@ void NCursesUI::check_resize(bool force)
} }
if (info) if (info)
info_show(m_info.title, m_info.content, m_info.anchor, m_info.face, m_info.style); info_show(m_info.title, m_info.content, m_info.anchor, m_info.face, m_info.style);
}
else
kak_assert(false);
ungetch(KEY_RESIZE); ungetch(KEY_RESIZE);
clearok(curscr, true); clearok(curscr, true);