=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/key-string.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- src/usr.bin/tmux/key-string.c 2011/01/01 03:43:20 1.19 +++ src/usr.bin/tmux/key-string.c 2011/01/23 11:04:25 1.20 @@ -1,4 +1,4 @@ -/* $OpenBSD: key-string.c,v 1.19 2011/01/01 03:43:20 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.20 2011/01/23 11:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -147,7 +147,7 @@ /* Is this a standard ASCII key? */ if (string[1] == '\0') { key = (u_char) string[0]; - if (key < 32 || key > 126) + if (key < 32 || key == 127 || key > 255) return (KEYC_NONE); } else { /* Otherwise look the key up in the table. */ @@ -213,7 +213,7 @@ } /* Invalid keys are errors. */ - if (key >= 127) + if (key == 127 || key > 255) return (NULL); /* Check for standard or control key. */ @@ -225,7 +225,9 @@ } else if (key >= 32 && key <= 126) { tmp[0] = key; tmp[1] = '\0'; - } + } else if (key >= 128) + xsnprintf(tmp, sizeof tmp, "\\%o", key); + strlcat(out, tmp, sizeof out); return (out); }