From 6e7ae9448ffffa5343c5735eefb2589892b49b87 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 27 Nov 2001 18:11:38 +0000 Subject: [PATCH] Initialize session and user-environment correctly. --- scsh/scsh-package.scm | 1 + scsh/startup.scm | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scsh/scsh-package.scm b/scsh/scsh-package.scm index 4811301..a8e4be7 100644 --- a/scsh/scsh-package.scm +++ b/scsh/scsh-package.scm @@ -280,6 +280,7 @@ package-commands-internal filenames ; translate usual-resumer ; usual-resumer + environments ; with-interaction-environment fluids-internal ; JMG: get-dynamic-env scsh-utilities interrupts diff --git a/scsh/startup.scm b/scsh/startup.scm index 84dbc8a..a318338 100644 --- a/scsh/startup.scm +++ b/scsh/startup.scm @@ -43,6 +43,7 @@ ;;; This is what we export to the user for his programs. (define (dump-scsh-program start filename) + (let ((context (user-context))) (really-dump-scsh-program (lambda (args) (with-scsh-sighandlers #f @@ -52,8 +53,17 @@ (install-env) (initialize-cwd) (init-scsh-vars #f) ; Do it quietly. - (start args)))))) - filename)) + (start-new-session context + (current-input-port) + (current-output-port) + (current-error-port) + args + #f) + (with-interaction-environment + (user-environment) + (lambda () + (start args)))))))) + filename))) (define (scsh-stand-alone-resumer start)