@@ -74,12 +74,12 @@ def urlretrieve(url, filename, reporthook=None):
7474
7575
7676DEFAULT_BUILDER_VERSIONS = {
77- "freebsd" : "2.0.5 " ,
77+ "freebsd" : "2.0.7 " ,
7878 "openbsd" : "2.0.0" ,
7979 "netbsd" : "2.0.3" ,
8080 "dragonflybsd" : "2.0.3" ,
8181 "solaris" : "2.0.0" ,
82- "omnios" : "2.0.3 " ,
82+ "omnios" : "2.0.4 " ,
8383 "haiku" : "2.0.0" ,
8484 "openindiana" : "2.0.3"
8585}
@@ -536,6 +536,8 @@ def fatal(msg):
536536let needsTimestamp = true;
537537let showTimestamp = false;
538538let audioContext = null;
539+ let isConnecting = true;
540+ const decoder = new TextDecoder();
539541
540542if (typeof IS_CONSOLE_VNC !== 'undefined' && IS_CONSOLE_VNC) {
541543 canvas.style.display = 'none';
@@ -603,13 +605,12 @@ def fatal(msg):
603605
604606 // Delay binding onData to prevent terminal response loops (like CPR)
605607 // when processing historical buffer on page load/refresh.
606- setTimeout(() => {
607- term.onData(data => {
608- if (ws && ws.readyState === WebSocket.OPEN) {
609- ws.send(new TextEncoder().encode(data));
610- }
611- });
612- }, 1000);
608+ term.onData(data => {
609+ if (isConnecting) return;
610+ if (ws && ws.readyState === WebSocket.OPEN) {
611+ ws.send(new TextEncoder().encode(data));
612+ }
613+ });
613614 } else {
614615 termContainer.innerHTML = '<div style="color: #f87171; padding: 20px; font-family: sans-serif;">Error: xterm.js not loaded. Serial output will appear as plain text below.</div><pre id="fallback-term" style="color: #f1f5f9; padding: 20px; white-space: pre-wrap; font-family: monospace; height: 100%; overflow: auto;"></pre>';
615616 }
@@ -651,7 +652,8 @@ def fatal(msg):
651652 if (typeof IS_CONSOLE_VNC !== 'undefined' && IS_CONSOLE_VNC) {
652653 window.initTerminal();
653654 connected = true;
654- setTimeout(() => { if (term) term.focus(); }, 200);
655+ isConnecting = true;
656+ setTimeout(() => { isConnecting = false; if (term) term.focus(); }, 1000);
655657 } else {
656658 canvas.focus();
657659 }
@@ -722,23 +724,27 @@ def fatal(msg):
722724 if (typeof IS_CONSOLE_VNC !== 'undefined' && IS_CONSOLE_VNC) {
723725 if (term) {
724726 try {
725- const text = new TextDecoder().decode(data);
726- const parts = text.split(/(\\ r?\\ n)/);
727-
728- for (const part of parts) {
729- if (part === '\\ n' || part === '\\ r\\ n') {
730- if (needsTimestamp) {
731- term.write(getTimeStr());
732- needsTimestamp = false;
733- }
734- term.write(part);
735- needsTimestamp = true;
736- } else if (part.length > 0) {
737- if (needsTimestamp) {
738- term.write(getTimeStr() + part);
739- needsTimestamp = false;
740- } else {
727+ if (!showTimestamp) {
728+ term.write(data);
729+ } else {
730+ const text = decoder.decode(data);
731+ const parts = text.split(/(\\ r?\\ n)/);
732+
733+ for (const part of parts) {
734+ if (part === '\\ n' || part === '\\ r\\ n') {
735+ if (needsTimestamp) {
736+ term.write(getTimeStr());
737+ needsTimestamp = false;
738+ }
741739 term.write(part);
740+ needsTimestamp = true;
741+ } else if (part.length > 0) {
742+ if (needsTimestamp) {
743+ term.write(getTimeStr() + part);
744+ needsTimestamp = false;
745+ } else {
746+ term.write(part);
747+ }
742748 }
743749 }
744750 }
0 commit comments