diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-09 20:23:45 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-09 20:23:45 +0100 |
commit | 05639c477367fa436ef33a0a4dc5fc37215acd94 (patch) | |
tree | 39397ecf384a611af004b6b393fefbf7492b92a6 /termkey.c | |
parent | a61b916c18f6997a76186609e0697bd893865412 (diff) | |
download | termo-05639c477367fa436ef33a0a4dc5fc37215acd94.tar.gz termo-05639c477367fa436ef33a0a4dc5fc37215acd94.tar.xz termo-05639c477367fa436ef33a0a4dc5fc37215acd94.zip |
Pass 'term' string into new_driver virtual method; have drivers sensitive to it and return NULL if they can't handle. Try CSI driver first; only for xterm-alikes
Diffstat (limited to 'termkey.c')
-rw-r--r-- | termkey.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -9,8 +9,8 @@ #include <stdio.h> static struct termkey_driver *drivers[] = { - &termkey_driver_ti, &termkey_driver_csi, + &termkey_driver_ti, NULL, }; @@ -133,8 +133,10 @@ termkey_t *termkey_new_full(int fd, int flags, size_t buffsize, int waittime) register_c0(tk, TERMKEY_SYM_ENTER, 0x0d, NULL); register_c0(tk, TERMKEY_SYM_ESCAPE, 0x1b, NULL); + const char *term = getenv("TERM"); + for(i = 0; drivers[i]; i++) { - void *driver_info = (*drivers[i]->new_driver)(tk); + void *driver_info = (*drivers[i]->new_driver)(tk, term); if(!driver_info) continue; |