diff --git a/scsh/top.scm b/scsh/top.scm index e444401..10c19d2 100644 --- a/scsh/top.scm +++ b/scsh/top.scm @@ -269,24 +269,30 @@ args context (lambda () - (display "welcome to scsh-0.6 alpha " + (display "Welcome to scsh 0.6 (Chinese Democracy) [alpha version]" + (current-output-port)) + (newline (current-output-port)) + (display "Type ,? for help and ,debug to enter the debugger" (current-output-port)) (newline (current-output-port)) (in-package (user-environment) '()))))) ((eq? term-switch 'c) - (scheme-exit-now - (eval (read-exactly-one-sexp-from-string term-val) - (interaction-environment)))) ) + (let ((result (eval (read-exactly-one-sexp-from-string term-val) + (interaction-environment)))) + (call-exit-hooks) + (scheme-exit-now result))) (top-entry ; There was a -e . - (scheme-exit-now ((eval top-entry (interaction-environment)) + (let ((result ((eval top-entry (interaction-environment)) (command-line)))) + (call-exit-hooks) + (scheme-exit-now result))) ;; Otherwise, the script executed as it loaded, ;; so we're done. - (else (scheme-exit-now 0)))))))))))) - + (else (call-exit-hooks) + (scheme-exit-now 0))))))))))))) (define (read-exactly-one-sexp-from-string s) @@ -295,6 +301,9 @@ (if (eof-object? (read)) val (error "More than one value read from string" s))))) +;;; placeholder for an extensible mechanism in the future +(define (call-exit-hooks) + (flush-all-ports)) (define (bad-arg . msg) (with-current-output-port (current-error-port)