*** empty log message ***
authorroot <root>
Tue, 11 Jan 2005 04:44:57 +0000 (04:44 +0000)
committerroot <root>
Tue, 11 Jan 2005 04:44:57 +0000 (04:44 +0000)
autoconf/config.h.in
autoconf/configure.in
src/ptytty.C

index d65a24b..d4a24ff 100644 (file)
 /* Define if you have the <libc.h> header file.  */
 #undef HAVE_LIBC_H
 
+/* Define if you have the <pty.h> header file.  */
+#undef HAVE_PTY_H
+
 /* Define if you have the <stdarg.h> header file.  */
 #undef HAVE_STDARG_H
 
index 0153921..86777dd 100644 (file)
@@ -522,6 +522,7 @@ AC_CHECK_HEADERS( \
        utmp.h \
        utmpx.h \
         stdint.h \
+        pty.h \
 )
 
 AC_HEADER_TIME
index 3c79ba0..93a5738 100644 (file)
@@ -48,6 +48,9 @@
 #ifdef HAVE_ISASTREAM
 # include <stropts.h>
 #endif
+#ifdef HAVE_PTY_H
+# include <pty.h>
+#endif
 
 // better do this via configure, but....
 #if defined(__FreeBSD__)
@@ -438,5 +441,32 @@ rxvt_ptytty::get ()
   return true;
 }
 
+void
+rxvt_ptytty::set_utf8_mode (bool on)
+{
+#ifdef IUTF8
+  if (pty != -1)
+    {
+      struct termios tio;
+
+      if (tcgetattr (pty, &tio) != -1)
+        {
+          tcflag_t new_cflag = tio.c_iflag;
+
+          if (on)
+            new_cflag |= IUTF8;
+          else
+            new_cflag &= ~IUTF8;
+
+          if (new_cflag != tio.c_iflag)
+            {
+              tio.c_iflag = new_cflag;
+              tcsetattr (pty, TCSANOW, &tio);
+            }
+        }
+    }
+#endif
+}
+
 /*----------------------- end-of-file (C source) -----------------------*/