summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cons/cons.c3
-rw-r--r--sys/dev/cons/cons_ansi.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/cons/cons.c b/sys/dev/cons/cons.c
index 8470a60..3eb7c33 100644
--- a/sys/dev/cons/cons.c
+++ b/sys/dev/cons/cons.c
@@ -488,7 +488,10 @@ void
cons_init(void)
{
struct fbdev fbdev = fbdev_get();
+ struct console_feat *featp;
+ featp = &g_root_scr.feat;
+ featp->ansi_esc = 1;
g_root_scr.ch_col = 0;
g_root_scr.ch_row = 0;
g_root_scr.fg = CONSOLE_FG;
diff --git a/sys/dev/cons/cons_ansi.c b/sys/dev/cons/cons_ansi.c
index fafb4ff..e00bdc9 100644
--- a/sys/dev/cons/cons_ansi.c
+++ b/sys/dev/cons/cons_ansi.c
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/cdefs.h>
+#include <sys/console.h>
#include <dev/cons/cons.h>
#include <dev/cons/ansi.h>
#include <string.h>
@@ -61,6 +62,8 @@ int
ansi_feed(struct ansi_state *statep, char c)
{
struct cons_screen *scr = &g_root_scr;
+ struct console_feat *featp;
+
/* Standard colors */
static uint32_t colortab[] = {
@@ -70,6 +73,11 @@ ansi_feed(struct ansi_state *statep, char c)
ANSI_CYAN, ANSI_WHITE
};
+ featp = &scr->feat;
+ if (!featp->ansi_esc) {
+ return 0;
+ }
+
/*
* Handle the control sequence introducer
* bytes.