- // Fetch dimensions
- if (isatty(ctx->pty.stdout.fd)) {
- r = ioctl(ctx->pty.stdout.fd, TIOCGWINSZ, &size);
- if (r) {
- CTX_ERROR(jail->ctx, "Failed to determine terminal dimensions: %s\n", strerror(errno));
- return -errno;
- }
+ if (ctx->flags & PAKFIRE_JAIL_PTY_FORWARDING) {
+ // Configure stdin/stdout
+ ctx->pty.stdin.fd = STDIN_FILENO;
+ ctx->pty.stdout.fd = STDOUT_FILENO;