diff options
Diffstat (limited to 'tty-term.c')
-rw-r--r-- | tty-term.c | 54 |
1 files changed, 48 insertions, 6 deletions
@@ -18,12 +18,15 @@ #include <sys/types.h> +#if defined(HAVE_CURSES_H) #include <curses.h> +#elif defined(HAVE_NCURSES_H) +#include <ncurses.h> +#endif #include <fnmatch.h> #include <stdlib.h> #include <string.h> #include <term.h> -#include <vis.h> #include "tmux.h" @@ -588,6 +591,12 @@ tty_term_create(struct tty *tty, char *name, char **caps, u_int ncaps, a = options_array_next(a); } + /* Delete curses data. */ +#if !defined(NCURSES_VERSION_MAJOR) || NCURSES_VERSION_MAJOR > 5 || \ + (NCURSES_VERSION_MAJOR == 5 && NCURSES_VERSION_MINOR > 6) + del_curterm(cur_term); +#endif + /* Apply overrides so any capabilities used for features are changed. */ tty_term_apply_overrides(term); @@ -723,7 +732,10 @@ tty_term_read_list(const char *name, int fd, char ***caps, u_int *ncaps, (*ncaps)++; } +#if !defined(NCURSES_VERSION_MAJOR) || NCURSES_VERSION_MAJOR > 5 || \ + (NCURSES_VERSION_MAJOR == 5 && NCURSES_VERSION_MINOR > 6) del_curterm(cur_term); +#endif return (0); } @@ -758,7 +770,13 @@ tty_term_string_i(struct tty_term *term, enum tty_code_code code, int a) { const char *x = tty_term_string(term, code), *s; - s = tparm((char *)x, a); +#if defined(HAVE_TIPARM_S) + s = tiparm_s(1, 0, x, a); +#elif defined(HAVE_TIPARM) + s = tiparm(x, a); +#else + s = tparm((char *)x, a, 0, 0, 0, 0, 0, 0, 0, 0); +#endif if (s == NULL) { log_debug("could not expand %s", tty_term_codes[code].name); return (""); @@ -771,7 +789,13 @@ tty_term_string_ii(struct tty_term *term, enum tty_code_code code, int a, int b) { const char *x = tty_term_string(term, code), *s; - s = tparm((char *)x, a, b); +#if defined(HAVE_TIPARM_S) + s = tiparm_s(2, 0, x, a, b); +#elif defined(HAVE_TIPARM) + s = tiparm(x, a, b); +#else + s = tparm((char *)x, a, b, 0, 0, 0, 0, 0, 0, 0); +#endif if (s == NULL) { log_debug("could not expand %s", tty_term_codes[code].name); return (""); @@ -785,7 +809,13 @@ tty_term_string_iii(struct tty_term *term, enum tty_code_code code, int a, { const char *x = tty_term_string(term, code), *s; - s = tparm((char *)x, a, b, c); +#if defined(HAVE_TIPARM_S) + s = tiparm_s(3, 0, x, a, b, c); +#elif defined(HAVE_TIPARM) + s = tiparm(x, a, b, c); +#else + s = tparm((char *)x, a, b, c, 0, 0, 0, 0, 0, 0); +#endif if (s == NULL) { log_debug("could not expand %s", tty_term_codes[code].name); return (""); @@ -798,7 +828,13 @@ tty_term_string_s(struct tty_term *term, enum tty_code_code code, const char *a) { const char *x = tty_term_string(term, code), *s; - s = tparm((char *)x, (long)a); +#if defined(HAVE_TIPARM_S) + s = tiparm_s(1, 1, x, a); +#elif defined(HAVE_TIPARM) + s = tiparm(x, a); +#else + s = tparm((char *)x, (long)a, 0, 0, 0, 0, 0, 0, 0, 0); +#endif if (s == NULL) { log_debug("could not expand %s", tty_term_codes[code].name); return (""); @@ -812,7 +848,13 @@ tty_term_string_ss(struct tty_term *term, enum tty_code_code code, { const char *x = tty_term_string(term, code), *s; - s = tparm((char *)x, (long)a, (long)b); +#if defined(HAVE_TIPARM_S) + s = tiparm_s(2, 3, x, a, b); +#elif defined(HAVE_TIPARM) + s = tiparm(x, a, b); +#else + s = tparm((char *)x, (long)a, (long)b, 0, 0, 0, 0, 0, 0, 0); +#endif if (s == NULL) { log_debug("could not expand %s", tty_term_codes[code].name); return (""); |