ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/ptytty.C
(Generate patch)

Comparing rxvt-unicode/src/ptytty.C (file contents):
Revision 1.16 by root, Sun Aug 15 03:30:04 2004 UTC vs.
Revision 1.22 by root, Tue Jan 11 04:44:57 2005 UTC

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
444void
445rxvt_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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines