=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/key-string.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/tmux/key-string.c 2010/06/05 15:51:53 1.17 --- src/usr.bin/tmux/key-string.c 2010/06/06 19:00:13 1.18 *************** *** 1,4 **** ! /* $OpenBSD: key-string.c,v 1.17 2010/06/05 15:51:53 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: key-string.c,v 1.18 2010/06/06 19:00:13 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 184,189 **** --- 184,198 ---- *out = '\0'; + /* + * Special case: display C-@ as C-Space. Could do this below in + * the (key >= 0 && key <= 32), but this way we let it be found + * in key_string_table, for the unlikely chance that we might + * change its name. + */ + if ((key & KEYC_MASK_KEY) == 0) + key = ' ' | KEYC_CTRL | (key & KEYC_MASK_MOD); + /* Fill in the modifiers. */ if (key & KEYC_CTRL) strlcat(out, "C-", sizeof out); *************** *** 191,197 **** strlcat(out, "M-", sizeof out); if (key & KEYC_SHIFT) strlcat(out, "S-", sizeof out); ! key &= ~(KEYC_CTRL|KEYC_ESCAPE|KEYC_SHIFT); /* Try the key against the string table. */ for (i = 0; i < nitems(key_string_table); i++) { --- 200,206 ---- strlcat(out, "M-", sizeof out); if (key & KEYC_SHIFT) strlcat(out, "S-", sizeof out); ! key &= KEYC_MASK_KEY; /* Try the key against the string table. */ for (i = 0; i < nitems(key_string_table); i++) {