mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
slave: set IUTF8
This commit is contained in:
parent
ae27a92153
commit
e310487dae
2 changed files with 15 additions and 0 deletions
|
|
@ -43,6 +43,7 @@
|
|||
on the wrap around.
|
||||
* Selection handling when viewport wrapped around.
|
||||
* Restore signal mask in the slave process.
|
||||
* Set `IUTF8`.
|
||||
|
||||
|
||||
### Security
|
||||
|
|
|
|||
14
slave.c
14
slave.c
|
|
@ -8,6 +8,7 @@
|
|||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
|
@ -99,6 +100,19 @@ slave_exec(int ptmx, char *argv[], int err_fd, bool login_shell)
|
|||
goto err;
|
||||
}
|
||||
|
||||
{
|
||||
struct termios flags;
|
||||
if (tcgetattr(pts, &flags) < 0) {
|
||||
LOG_ERRNO("failed to get terminal attributes");
|
||||
goto err;
|
||||
}
|
||||
|
||||
flags.c_iflag |= IUTF8;
|
||||
if (tcsetattr(pts, TCSANOW, &flags) < 0) {
|
||||
LOG_ERRNO("failed to set IUTF8 terminal attribute");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (dup2(pts, STDIN_FILENO) == -1 ||
|
||||
dup2(pts, STDOUT_FILENO) == -1 ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue