agentgui 1.0.486 → 1.0.487
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/js/terminal.js +19 -6
package/package.json
CHANGED
package/static/js/terminal.js
CHANGED
|
@@ -115,16 +115,29 @@
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
function initTerminalEarly() {
|
|
119
|
+
console.log('Terminal: Initializing terminal early (not yet active)');
|
|
120
|
+
if (!ensureTerm()) {
|
|
121
|
+
console.log('Terminal: Waiting for xterm.js to load');
|
|
122
|
+
setTimeout(initTerminalEarly, 200);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
console.log('Terminal: Terminal UI initialized and ready for interaction');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (document.readyState === 'loading') {
|
|
129
|
+
document.addEventListener('DOMContentLoaded', initTerminalEarly);
|
|
130
|
+
} else {
|
|
131
|
+
initTerminalEarly();
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
window.addEventListener('view-switched', function(e) {
|
|
126
135
|
if (e.detail.view === 'terminal') {
|
|
127
|
-
|
|
136
|
+
if (!termActive) {
|
|
137
|
+
termActive = true;
|
|
138
|
+
connectAndStart();
|
|
139
|
+
setTimeout(function() { if (fitAddon) try { fitAddon.fit(); } catch(_) {} }, 100);
|
|
140
|
+
}
|
|
128
141
|
} else if (termActive) {
|
|
129
142
|
stopTerminal();
|
|
130
143
|
}
|