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.18 by root, Sun Dec 12 05:54:05 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// better do this via configure, but.... 55// better do this via configure, but....
53#if defined(__FreeBSD__) 56#if defined(__FreeBSD__)
54# include <libutil.h> 57# include <libutil.h>
55#elif defined(__DARWIN__) || (defined (__MACH__) && defined (__APPLE__)) 58#elif defined(__DARWIN__) || (defined (__MACH__) && defined (__APPLE__))
436 } 439 }
437 440
438 return true; 441 return true;
439} 442}
440 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
441/*----------------------- end-of-file (C source) -----------------------*/ 471/*----------------------- end-of-file (C source) -----------------------*/
442 472

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines