From 622ef7a99f7804752f3ca6b525ed6cc58b9493b1 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Thu, 11 Mar 2004 09:54:33 +0000 Subject: [PATCH] Install handler in CALL-TERMINALLY so scsh with exit with status 1 in case of an error. --- scsh/scsh-package.scm | 1 + scsh/scsh.scm | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scsh/scsh-package.scm b/scsh/scsh-package.scm index 2eeb7b6..cf935f5 100644 --- a/scsh/scsh-package.scm +++ b/scsh/scsh-package.scm @@ -232,6 +232,7 @@ general-tables simple-syntax exit-hooks + display-conditions scsh-endian) (for-syntax (open scsh-syntax-helpers scheme)) diff --git a/scsh/scsh.scm b/scsh/scsh.scm index c20ebac..2d88cfa 100644 --- a/scsh/scsh.scm +++ b/scsh/scsh.scm @@ -10,10 +10,15 @@ (with-continuation null-continuation (lambda () - (dynamic-wind - (lambda () (values)) - thunk - (lambda () (exit 0)))))) + (with-handler + (lambda (c more) + (display-condition c (current-error-port)) + (exit 1)) + (lambda () + (dynamic-wind + (lambda () (values)) + thunk + (lambda () (exit 0)))))))) ;; from shift-reset.scm: (define null-continuation #f)