Skip to content

Ignore added "line clear" characters in the Web Workflow serial #9934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions supervisor/shared/web_workflow/static/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ ws.onmessage = function(e) {
} else if (e.data == "\x1b[K") { // Clear line
log.textContent = log.textContent.slice(0, -left_count);
left_count = 0;
} else if (e.data == "\x1b[2K\x1b[0G") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to instead ignore every escape sequence.

This could be done really fast with ignoring everything from when we see "ESC[" to whenever we see an alphabet letter.
(65-90 or 97-122, the alphabet letter should be discarded too)

// ignore
} else {
log.textContent += e.data;
}
Expand Down