summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-01-04 00:20:18 +0000
committered <ed@FreeBSD.org>2009-01-04 00:20:18 +0000
commit047939807a8f612d4d761c69423544ba814f7c1d (patch)
tree622153b1edc9e5962f62b9cf438dff83c8c514bd /sys/dev/syscons
parent29029a97b0f154c8bdeb9ce2cd9cf875d1c7206c (diff)
downloadFreeBSD-src-047939807a8f612d4d761c69423544ba814f7c1d.zip
FreeBSD-src-047939807a8f612d4d761c69423544ba814f7c1d.tar.gz
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.
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/teken/teken.c6
-rw-r--r--sys/dev/syscons/teken/teken_demo.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/syscons/teken/teken.c b/sys/dev/syscons/teken/teken.c
index acf35f7..b3c8bd4 100644
--- a/sys/dev/syscons/teken/teken.c
+++ b/sys/dev/syscons/teken/teken.c
@@ -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 */
diff --git a/sys/dev/syscons/teken/teken_demo.c b/sys/dev/syscons/teken/teken_demo.c
index 74b4321..acea4f7 100644
--- a/sys/dev/syscons/teken/teken_demo.c
+++ b/sys/dev/syscons/teken/teken_demo.c
@@ -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);
OpenPOWER on IntegriCloud