diff --git a/mithril.scm b/mithril.scm index 1d101f0..33c9257 100644 --- a/mithril.scm +++ b/mithril.scm @@ -47,7 +47,10 @@ that the DOM and running scripts can be modified. PROMPT specifies the user prompt." (let* ((add-line (lambda (state text prompt?) - (set! state.lines (cons `&(:text ,text :prompt ,prompt?) state.lines)))) + (map + (lambda (l) + (set! state.lines (cons `&(:text ,l :prompt ,prompt?) state.lines))) + (string-split "\n" text)))) (evaluate (lambda (state cmd) (add-line state (format "~a~a" prompt cmd) #t) (let ((res (eval (with-input-from-string cmd read))))