aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/pty.c
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-04-04 19:22:04 +0300
committerCan Celik <ogulcancelik@gmail.com>2026-04-05 01:23:06 +0300
commit41dd733ca7123c9ac4bfc6c781697a660e95b052 (patch)
tree3fc91815ca139ef2e0b281bba0abda4ef15175f4 /vendor/libghostty-vt/src/pty.c
parent55c138263e190a1e79d4b997bfb9397306c0ec1f (diff)
feat: finish ghostty pane backend integration
Diffstat (limited to 'vendor/libghostty-vt/src/pty.c')
-rw-r--r--vendor/libghostty-vt/src/pty.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/pty.c b/vendor/libghostty-vt/src/pty.c
new file mode 100644
index 00000000..fe50d2b4
--- /dev/null
+++ b/vendor/libghostty-vt/src/pty.c
@@ -0,0 +1,40 @@
+#if defined(__FreeBSD__)
+
+ #include <termios.h> // ioctl and constants
+ #include <libutil.h> // openpty
+ #include <stdlib.h> // ptsname_r
+ #include <unistd.h> // tcgetpgrp
+
+#elif defined(__linux__)
+
+ #define _GNU_SOURCE // ptsname_r
+ #include <pty.h> // openpty
+ #include <stdlib.h> // ptsname_r
+ #include <sys/ioctl.h> // ioctl and constants
+ #include <unistd.h> // tcgetpgrp, setsid
+
+#elif defined(__APPLE__)
+
+ #include <sys/ioctl.h> // ioctl and constants
+ #include <sys/ttycom.h> // ioctl and constants for TIOCPTYGNAME
+ #include <sys/types.h>
+ #include <unistd.h> // tcgetpgrp
+ #include <util.h> // openpty
+
+ #ifndef tiocsctty
+ #define tiocsctty 536900705
+ #endif
+
+ #ifndef tiocswinsz
+ #define tiocswinsz 2148037735
+ #endif
+
+ #ifndef tiocgwinsz
+ #define tiocgwinsz 1074295912
+ #endif
+
+#else
+
+ #error "unsupported platform"
+
+#endif