diff --git a/gems/include/terminal/decoder.h b/gems/include/terminal/decoder.h index 5b254ae5b4..7cb20e4df3 100644 --- a/gems/include/terminal/decoder.h +++ b/gems/include/terminal/decoder.h @@ -329,7 +329,20 @@ namespace Terminal { case 'H': return (_screen.cup(p1, p2), true); case 'm': if ((p1 == 39) && (p2 == 49)) return (_screen.op(), true); - if ((p1 == 0) && (p2 == 10)) return (_screen.sgr(0), true); + if ((p1 == 0 || p1 == 1) && (p2 >= 30) && (p2 <= 37)) { + /* + * p1 encodes attribute (see 'dircolors -p') + * 0 -> normal + * 1 -> bold (turn into highlight) + * + * p2 encodes color + * 30...37 text colors + * 40...47 background colors + */ + _screen.sgr(p1); + _screen.setaf(p2 - 30); + return true; + } return false; case 'R': return (_screen.u6(p1, p2), true); default: return false;