diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-11-09 22:41:44 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-11-09 22:41:44 +0000 |
commit | 9757a73daa063ffca5705ae8732869ecc99f2b59 (patch) | |
tree | 428eec18277b89013aa98250997ed677084ca631 | |
parent | 30a3356815bb3d2293ba4bda2017703a758f1c94 (diff) | |
download | termo-9757a73daa063ffca5705ae8732869ecc99f2b59.tar.gz termo-9757a73daa063ffca5705ae8732869ecc99f2b59.tar.xz termo-9757a73daa063ffca5705ae8732869ecc99f2b59.zip |
CSI driver should also load when TERM=screen because of screen's stupid way of blind-forwarding keypresses it doesn't understand
-rw-r--r-- | driver-csi.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/driver-csi.c b/driver-csi.c index c03c98f..8963f20 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -26,12 +26,19 @@ static termkey_keysym register_csifunc_full(termkey_csi *csi, termkey_type type, static void *new_driver(termkey_t *tk, const char *term) { - // Only care about term types beginning "xterm" - if(strncmp(term, "xterm", 5) != 0) - return NULL; - - // We want "xterm" or "xtermc" or "xterm-..." - if(term[5] != 0 && term[5] != '-' && term[5] != 'c') + if(strncmp(term, "xterm", 5) == 0) { + // We want "xterm" or "xtermc" or "xterm-..." + if(term[5] != 0 && term[5] != '-' && term[5] != 'c') + return NULL; + } + else if(strcmp(term, "screen") == 0) { + /* Also apply for screen, because it might be transporting xterm-like + * sequences. Yes, this sucks. We shouldn't need to rely on this behaviour + * but there's no other way to know, and if we don't then we won't + * recognise its sequences. + */ + } + else return NULL; // Excellent - we'll continue |