Use \u001B instead of (hidden) ESC character

Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser
2025-07-19 21:53:26 +02:00
parent b4af886192
commit 55e8e4a328

View File

@@ -92,7 +92,7 @@ function parseLines(outputElement, text) {
if (line[0] === "\r") {
// This line starts with the "OVER" sequence. Replace them with "\n" before print
// we also escape HTML to prevent XSS attacks
line = utils.escapeHtml(line.replaceAll("\r", "\n").replaceAll("\r", "\n"));
line = utils.escapeHtml(line.replaceAll("\r\u001B[K", "\n").replaceAll("\r", "\n"));
// Last line from the textarea will be overwritten, so we remove it
const lastLineIndex = outputElement.innerHTML.lastIndexOf("\n");