Print control characters, even though they are normally not visible.

With cons25, there are printable characters below 0x1B. This is not the
case with ASCII, UTF-8, etc. but in this case we just have to.

Also don't set LC_CTYPE to UTF-8 when libteken is compiled without UTF-8
in the demo-application.
This commit is contained in:
ed 2009-01-04 00:20:18 +00:00
parent 29029a97b0
commit 047939807a
2 changed files with 7 additions and 1 deletions

View File

@ -53,10 +53,14 @@ static FILE *df;
#include "teken_wcwidth.h"
#else /* !TEKEN_UTF8 */
static inline int
teken_wcwidth(teken_char_t c)
teken_wcwidth(teken_char_t c __unused)
{
#ifdef TEKEN_CONS25
return (1);
#else /* !TEKEN_CONS25 */
return (c <= 0x1B) ? -1 : 1;
#endif /* TEKEN_CONS25 */
}
#endif /* TEKEN_UTF8 */

View File

@ -280,7 +280,9 @@ main(int argc __unused, char *argv[] __unused)
exit(1);
case 0:
setenv("TERM", "cons25", 1);
#ifdef TEKEN_UTF8
setenv("LC_CTYPE", "UTF-8", 0);
#endif /* TEKEN_UTF8 */
execlp("zsh", "-zsh", NULL);
execlp("bash", "-bash", NULL);
execlp("sh", "-sh", NULL);