openbsd-ports/x11/aterm/patches/patch-src_command_c
uwe d3dbbe9d36 Don't forget to initialize the VSTATUS control character for the new pty
when stdin is not a terminal; Ok sturm@ for a similar diff
2006-03-22 20:17:40 +00:00

75 lines
1.9 KiB
Plaintext

--- src/command.c.orig Thu Sep 6 18:38:07 2001
+++ src/command.c Wed Mar 22 21:09:34 2006
@@ -477,6 +477,16 @@ get_pty(void)
ptydev = ttydev = _getpty(&fd, O_RDWR | O_NDELAY, 0622, 0);
if (ptydev == NULL)
goto Failed;
+#elif defined (__OpenBSD__)
+ int sfd;
+ static char tty_name[16];
+
+ ptydev = ttydev = tty_name;
+
+ if (openpty(&fd, &sfd, tty_name, NULL, NULL) < 0)
+ goto Failed;
+ close(sfd);
+
#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__)
{
extern char *ptsname();
@@ -759,6 +769,9 @@ debug_ttymode(ttymode_t * ttymode)
# ifdef VLNEXT
FOO(VLNEXT, "VLNEXT");
# endif
+# ifdef VSTATUS
+ FOO(VSTATUS, "VSTATUS");
+# endif
fprintf(stderr, "\n\n");
# undef FOO
# endif /* HAVE_TERMIOS_H */
@@ -799,6 +812,9 @@ get_ttymode(ttymode_t * tio)
# ifdef VLNEXT
tio->c_cc[VLNEXT] = CLNEXT;
# endif
+# ifdef VSTATUS
+ tio->c_cc[VSTATUS] = CSTATUS;
+# endif
}
tio->c_cc[VEOF] = CEOF;
tio->c_cc[VEOL] = VDISABLE;
@@ -2148,11 +2164,23 @@ process_x_event(XEvent * ev)
static int bypass_keystate = 0;
int reportmode;
static int csrO = 0; /* Hops - csr offset in thumb/slider */
+#ifdef ZH
+ int k_status;
+ char kbuf[256];
+#endif
/* to give proper Scroll behaviour */
switch (ev->type) {
case KeyPress:
- lookup_key(ev);
+#ifdef ZH
+ k_status = send_key(Xdisplay, TermWin.parent, &ev->xkey, kbuf);
+ if (!k_status)
+ lookup_key(ev);
+ else if (kbuf[0])
+ tt_write(kbuf, strlen(kbuf));
+#else
+ lookup_key(ev);
+#endif
break;
case ClientMessage:
@@ -2217,6 +2245,9 @@ process_x_event(XEvent * ev)
case FocusIn:
if (!TermWin.focus) {
+#ifdef ZH
+ send_FocusIn(Xdisplay, TermWin.parent);
+#endif
TermWin.focus = 1;
#ifdef OFF_FOCUS_FADING
if( rs_fade != NULL )