Terminal: Set terminal size with TIOCSWINSZ when starting

This actually fixes the very broken vim port
This commit is contained in:
Bananymous 2024-12-21 03:23:21 +02:00
parent 69137cddab
commit 6f8f99f42c
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include <ctype.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <unistd.h>
@ -119,6 +120,14 @@ void Terminal::run()
m_font = MUST(LibFont::Font::load("/usr/share/fonts/lat0-16.psfu"_sv));
{
winsize winsize;
winsize.ws_col = cols();
winsize.ws_row = rows();
if (ioctl(m_shell_info.pts_master, TIOCSWINSZ, &winsize) == -1)
perror("ioctl");
}
{
timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);