aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/core/module-loader.js2
-rw-r--r--modules/ext/course.js18
2 files changed, 17 insertions, 3 deletions
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();