=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/tmux/window.c 2009/09/01 14:40:33 1.24 --- src/usr.bin/tmux/window.c 2009/09/16 12:35:04 1.25 *************** *** 1,4 **** ! /* $OpenBSD: window.c,v 1.24 2009/09/01 14:40:33 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window.c,v 1.25 2009/09/16 12:35:04 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 454,459 **** --- 454,460 ---- struct environ_entry *envent; const char *ptr; struct timeval tv; + struct termios tio2; u_int i; if (wp->fd != -1) *************** *** 484,490 **** tv.tv_usec = NAME_INTERVAL * 1000L; timeradd(&wp->window->name_timer, &tv, &wp->window->name_timer); ! switch (wp->pid = forkpty(&wp->fd, wp->tty, tio, &ws)) { case -1: wp->fd = -1; xasprintf(cause, "%s: %s", cmd, strerror(errno)); --- 485,491 ---- tv.tv_usec = NAME_INTERVAL * 1000L; timeradd(&wp->window->name_timer, &tv, &wp->window->name_timer); ! switch (wp->pid = forkpty(&wp->fd, wp->tty, NULL, &ws)) { case -1: wp->fd = -1; xasprintf(cause, "%s: %s", cmd, strerror(errno)); *************** *** 492,497 **** --- 493,506 ---- case 0: if (chdir(wp->cwd) != 0) chdir("/"); + + if (tcgetattr(STDIN_FILENO, &tio2) != 0) + fatal("tcgetattr failed"); + if (tio != NULL) + memcpy(tio2.c_cc, tio->c_cc, sizeof tio2.c_cc); + tio2.c_cc[VERASE] = '\177'; + if (tcsetattr(STDIN_FILENO, TCSANOW, &tio2) != 0) + fatal("tcgetattr failed"); ARRAY_INIT(&varlist); for (varp = environ; *varp != NULL; varp++) {