=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty-keys.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/tmux/tty-keys.c 2009/07/21 17:57:29 1.2 --- src/usr.bin/tmux/tty-keys.c 2009/07/26 21:42:08 1.3 *************** *** 1,4 **** ! /* $OpenBSD: tty-keys.c,v 1.2 2009/07/21 17:57:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty-keys.c,v 1.3 2009/07/26 21:42:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 20,25 **** --- 20,27 ---- #include #include + #include + #include #include "tmux.h" *************** *** 235,240 **** --- 237,243 ---- struct timeval tv; char *buf; size_t len, size; + cc_t bspace; buf = BUFFER_OUT(tty->in); len = BUFFER_USED(tty->in); *************** *** 245,250 **** --- 248,262 ---- /* If a normal key, return it. */ if (*buf != '\033') { *key = buffer_read8(tty->in); + + /* + * Check for backspace key using termios VERASE - the terminfo + * kbs entry is extremely unreliable, so cannot be safely + * used. termios should have a better idea. + */ + bspace = tty->tio.c_cc[VERASE]; + if (bspace != _POSIX_VDISABLE && *key == bspace) + *key = KEYC_BSPACE; goto found; }