This commit is contained in:
Kovid Goyal 2020-05-23 19:56:51 +05:30
commit 581548ed67
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Wayland: Fix kitty being killed on some Wayland compositors if a hidden window - Wayland: Fix kitty being killed on some Wayland compositors if a hidden window
has a lot of output (:iss:`2329`) has a lot of output (:iss:`2329`)
- BSD: Fix controlling terminal not being established (:pull:`2686`)
0.17.4 [2020-05-09] 0.17.4 [2020-05-09]
-------------------- --------------------

View File

@ -12,6 +12,8 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <sys/ioctl.h>
#include <termios.h>
static inline char** static inline char**
serialize_string_tuple(PyObject *src) { serialize_string_tuple(PyObject *src) {
@ -93,7 +95,7 @@ spawn(PyObject *self UNUSED, PyObject *args) {
// Establish the controlling terminal (see man 7 credentials) // Establish the controlling terminal (see man 7 credentials)
int tfd = open(name, O_RDWR); int tfd = open(name, O_RDWR);
if (tfd == -1) exit_on_err("Failed to open controlling terminal"); if (tfd == -1) exit_on_err("Failed to open controlling terminal");
#ifdef TIOCSTTY #ifdef TIOCSCTTY
// On BSD open() does not establish the controlling terminal // On BSD open() does not establish the controlling terminal
if (ioctl(tfd, TIOCSCTTY, 0) == -1) exit_on_err("Failed to set controlling terminal with TIOCSCTTY"); if (ioctl(tfd, TIOCSCTTY, 0) == -1) exit_on_err("Failed to set controlling terminal with TIOCSCTTY");
#endif #endif