mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
Merge branch 'initial-tiocswinsz'
This commit is contained in:
commit
f1c8ccddde
2 changed files with 10 additions and 0 deletions
|
|
@ -48,6 +48,8 @@
|
|||
* Selection of double-width characters. It is no longer possible to
|
||||
select half of a double-width character.
|
||||
* Draw hollow block cursor on top of character.
|
||||
* Set an initial `TIOCSWINSZ`. This ensures clients never reads a
|
||||
`0x0` terminal size (https://codeberg.org/dnkl/foot/issues/20).
|
||||
|
||||
### Security
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/timerfd.h>
|
||||
|
|
@ -759,6 +760,13 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
|
|||
goto close_fds;
|
||||
}
|
||||
|
||||
if (ioctl(ptmx, TIOCSWINSZ,
|
||||
&(struct winsize){.ws_row = 24, .ws_col = 80}) < 0)
|
||||
{
|
||||
LOG_ERRNO("failed to set initial TIOCSWINSZ");
|
||||
goto close_fds;
|
||||
}
|
||||
|
||||
int ptmx_flags;
|
||||
if ((ptmx_flags = fcntl(ptmx, F_GETFL)) < 0 ||
|
||||
fcntl(ptmx, F_SETFL, ptmx_flags | O_NONBLOCK) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue