=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty-term.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/tmux/tty-term.c 2010/09/11 15:43:11 1.17 --- src/usr.bin/tmux/tty-term.c 2010/09/11 16:19:22 1.18 *************** *** 1,4 **** ! /* $OpenBSD: tty-term.c,v 1.17 2010/09/11 15:43:11 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty-term.c,v 1.18 2010/09/11 16:19:22 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 302,307 **** --- 302,308 ---- u_int i; int n, error; char *s; + const char *acs; SLIST_FOREACH(term, &tty_terms, entry) { if (strcmp(term->name, name) == 0) { *************** *** 315,321 **** term->name = xstrdup(name); term->references = 1; term->flags = 0; ! memset(&term->codes, 0, sizeof term->codes); SLIST_INSERT_HEAD(&tty_terms, term, entry); /* Set up curses terminal. */ --- 316,322 ---- term->name = xstrdup(name); term->references = 1; term->flags = 0; ! memset(term->codes, 0, sizeof term->codes); SLIST_INSERT_HEAD(&tty_terms, term, entry); /* Set up curses terminal. */ *************** *** 410,415 **** --- 411,425 ---- */ if (!tty_term_flag(term, TTYC_XENL)) term->flags |= TERM_EARLYWRAP; + + /* Generate ACS table. If none is present, use nearest ASCII. */ + memset(term->acs, 0, sizeof term->acs); + if (tty_term_has(term, TTYC_ACSC)) + acs = tty_term_string(term, TTYC_ACSC); + else + acs = "a#j+k+l+m+n+o-p-q-r-s-t+u+v+w+x|y~."; + for (; acs[0] != '\0' && acs[1] != '\0'; acs += 2) + term->acs[(u_char) acs[0]][0] = acs[1]; return (term);