diff --git a/src/octoprint/static/js/app/viewmodels/terminal.js b/src/octoprint/static/js/app/viewmodels/terminal.js index a041974aa..dbb8ec1f8 100644 --- a/src/octoprint/static/js/app/viewmodels/terminal.js +++ b/src/octoprint/static/js/app/viewmodels/terminal.js @@ -288,11 +288,26 @@ $(function () { self.updateOutput(); }; - self._toInternalFormat = function (line, type) { - if (type == undefined) { - type = "line"; + self._toInternalFormat = function (line, display, type) { + if (display === undefined) { + display = "line"; } - return {line: escapeUnprintableCharacters(line), type: type}; + + if (type === undefined) { + if (line.startsWith("Recv:")) { + type = "recv"; + } else if (line.startsWith("Send:")) { + type = "send"; + } else if (line.startsWith("Warn:")) { + type = "warn"; + } + } + + return { + line: escapeUnprintableCharacters(line), + display: display, + type: type + }; }; self._processStateData = function (data) { diff --git a/src/octoprint/templates/tabs/terminal.jinja2 b/src/octoprint/templates/tabs/terminal.jinja2 index eb0cc291b..20eed9104 100644 --- a/src/octoprint/templates/tabs/terminal.jinja2 +++ b/src/octoprint/templates/tabs/terminal.jinja2 @@ -1,5 +1,5 @@
-
+