diff options
| -rw-r--r-- | main.html | 6 | ||||
| -rw-r--r-- | modules/core/module-loader.js | 2 | ||||
| -rw-r--r-- | modules/ext/course.js | 18 |
3 files changed, 20 insertions, 6 deletions
@@ -1349,13 +1349,13 @@ </script> <!-- v4.5.63: A2A scratchpad fixes + agent-register arg fix --> -<script src="modules/core/core-bundle.js?v=v4.6.35"></script> +<script src="modules/core/core-bundle.js?v=v4.6.36"></script> <!-- Async dependency-ordered module loader now only initializes terminal and loads optional ext modules --> -<script src="modules/core/module-loader.js?v=v4.6.35"></script> +<script src="modules/core/module-loader.js?v=v4.6.36"></script> <!-- Critical ext bundle loads AFTER webx11 exists so registerModule calls work --> -<script src="modules/ext/critical-ext-bundle.js?v=v4.6.35"></script> +<script src="modules/ext/critical-ext-bundle.js?v=v4.6.36"></script> <script> // ═══ ONE TRUE VERSION SOURCE ═══ diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js index 3a85417..f060bde 100644 --- a/modules/core/module-loader.js +++ b/modules/core/module-loader.js @@ -4,7 +4,7 @@ // Core module bundle loaded synchronously in main.html. // This loader only handles version cache-busting, splash, terminal init, and optional ext modules. - const LATEST_VER = 'v4.6.35'; + const LATEST_VER = 'v4.6.36'; const CACHE = '?v=' + LATEST_VER; const stored = localStorage.getItem('webx11_cache_ver'); if (stored !== LATEST_VER) { diff --git a/modules/ext/course.js b/modules/ext/course.js index 3e00229..d3b96de 100644 --- a/modules/ext/course.js +++ b/modules/ext/course.js @@ -175,14 +175,28 @@ class CourseModule { onCommandStart(cmd, args) { if (cmd === 'course') return; - if (this._capActive) { try { this.terminal._popPrintCapture(); } catch (e) {} this._capActive = false; } + // Only capture while an exercise is actually running. Capturing every command + // swallowed all terminal output (pwd/help/version printed nothing). + if (!this._active || !this._active.lesson || !this._active.lesson.exercise) return; + if (this._capActive) { + try { this.terminal._popPrintCapture(); } catch (e) {} + if (this._capOut) { try { this.terminal.print(this._capOut.replace(/\n+$/, '')); } catch (e) {} } + this._capActive = false; + } this._capOut = ''; this._capActive = true; try { this.terminal._pushPrintCapture(txt => { this._capOut = txt; }); } catch (e) { this._capActive = false; } } onCommandExecuted(cmd, args) { - if (this._capActive) { try { this.terminal._popPrintCapture(); } catch (e) {} this._capActive = false; } + let cap = ''; + if (this._capActive) { + cap = this._capOut || ''; + try { this.terminal._popPrintCapture(); } catch (e) {} + this._capActive = false; + } + // Never swallow the user's output: replay it after the capture is popped. + if (cap.trim()) { try { this.terminal.print(cap.replace(/\n+$/, '')); } catch (e) {} } if (!this._active || !this._active.lesson.exercise || cmd === 'course') return; const ex = this._active.lesson.exercise; const line = (cmd + (args.length ? ' ' + args.join(' ') : '')).trim(); |