aboutsummaryrefslogtreecommitdiff
path: root/modules/ext/course.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ext/course.js')
-rw-r--r--modules/ext/course.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ext/course.js b/modules/ext/course.js
index d3b96de..8c615ec 100644
--- a/modules/ext/course.js
+++ b/modules/ext/course.js
@@ -177,7 +177,10 @@ class CourseModule {
if (cmd === 'course') return;
// 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._active || !this._active.lesson || !this._active.lesson.exercise) {
+ this._capOut = ''; // never let a previous command's output satisfy an output-check exercise
+ return;
+ }
if (this._capActive) {
try { this.terminal._popPrintCapture(); } catch (e) {}
if (this._capOut) { try { this.terminal.print(this._capOut.replace(/\n+$/, '')); } catch (e) {} }