Fix major durp in code with CNET codes
This commit is contained in:
parent
098e3c2fba
commit
03662dc056
|
@ -245,20 +245,24 @@ function controlCodesToAnsi(s, client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
result += s.substr(lastIndex, m.index - lastIndex) + v;
|
result += s.substr(lastIndex, m.index - lastIndex) + v;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\x19' :
|
case '\x19' :
|
||||||
case '\0x11' :
|
case '\0x11' :
|
||||||
// CNET "Y-Style" & "Q-Style"
|
// CNET "Y-Style" & "Q-Style"
|
||||||
v = m[9] || m[11];
|
v = m[9] || m[11];
|
||||||
if('n1' === v) {
|
if(v) {
|
||||||
result += '\n';
|
if('n1' === v) {
|
||||||
} else if('f1' === v) {
|
v = '\n';
|
||||||
result += ANSI.clearScreen();
|
} else if('f1' === v) {
|
||||||
|
v = ANSI.clearScreen();
|
||||||
|
} else {
|
||||||
|
v = ansiSgrFromCnetStyleColorCode(v);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result += ansiSgrFromCnetStyleColorCode(v);
|
v = m[0];
|
||||||
}
|
}
|
||||||
|
result += s.substr(lastIndex, m.index - lastIndex) + v;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue