… | |
… | |
46 | # include <sys/stropts.h> /* for I_PUSH */ |
46 | # include <sys/stropts.h> /* for I_PUSH */ |
47 | #endif |
47 | #endif |
48 | #ifdef HAVE_ISASTREAM |
48 | #ifdef HAVE_ISASTREAM |
49 | # include <stropts.h> |
49 | # include <stropts.h> |
50 | #endif |
50 | #endif |
|
|
51 | #ifdef HAVE_PTY_H |
|
|
52 | # include <pty.h> |
|
|
53 | #endif |
51 | |
54 | |
52 | #if defined( __FreeBSD__) |
|
|
53 | // better do this via configure, but.... |
55 | // better do this via configure, but.... |
|
|
56 | #if defined(__FreeBSD__) |
54 | # include <libutil.h> |
57 | # include <libutil.h> |
|
|
58 | #elif defined(__DARWIN__) || (defined (__MACH__) && defined (__APPLE__)) |
|
|
59 | # include <util.h> |
55 | #endif |
60 | #endif |
56 | |
61 | |
57 | #include <cstdio> |
62 | #include <cstdio> |
58 | #include <grp.h> |
63 | #include <grp.h> |
59 | |
64 | |
… | |
… | |
434 | } |
439 | } |
435 | |
440 | |
436 | return true; |
441 | return true; |
437 | } |
442 | } |
438 | |
443 | |
|
|
444 | void |
|
|
445 | rxvt_ptytty::set_utf8_mode (bool on) |
|
|
446 | { |
|
|
447 | #ifdef IUTF8 |
|
|
448 | if (pty != -1) |
|
|
449 | { |
|
|
450 | struct termios tio; |
|
|
451 | |
|
|
452 | if (tcgetattr (pty, &tio) != -1) |
|
|
453 | { |
|
|
454 | tcflag_t new_cflag = tio.c_iflag; |
|
|
455 | |
|
|
456 | if (on) |
|
|
457 | new_cflag |= IUTF8; |
|
|
458 | else |
|
|
459 | new_cflag &= ~IUTF8; |
|
|
460 | |
|
|
461 | if (new_cflag != tio.c_iflag) |
|
|
462 | { |
|
|
463 | tio.c_iflag = new_cflag; |
|
|
464 | tcsetattr (pty, TCSANOW, &tio); |
|
|
465 | } |
|
|
466 | } |
|
|
467 | } |
|
|
468 | #endif |
|
|
469 | } |
|
|
470 | |
439 | /*----------------------- end-of-file (C source) -----------------------*/ |
471 | /*----------------------- end-of-file (C source) -----------------------*/ |
440 | |
472 | |