Add variable shell-file-name and initialize it properly.
authorChris Hanson <org/chris-hanson/cph>
Tue, 24 Nov 1992 21:14:45 +0000 (21:14 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 24 Nov 1992 21:14:45 +0000 (21:14 +0000)
v7/src/edwin/process.scm

index 75631221a7303f619503957c661234a4efcf28ec..26b1d6ebd00f006d53a0044a2c4559a18f999220 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: process.scm,v 1.25 1992/09/23 23:03:55 jinx Exp $
+;;;    $Id: process.scm,v 1.26 1992/11/24 21:14:45 cph Exp $
 ;;;
 ;;;    Copyright (c) 1991-1992 Massachusetts Institute of Technology
 ;;;
 
 (define (initialize-processes!)
   (set! edwin-processes '())
-  (let ((path (get-environment-variable "PATH")))
-    (if (not path)
-       (error "Can't find PATH environment variable."))
-    (set-variable! exec-path (parse-path-string path))))
+  (set-variable-default-value!
+   (ref-variable-object exec-path)
+   (parse-path-string
+    (let ((path (get-environment-variable "PATH")))
+      (if (not path)
+         (error "Can't find PATH environment variable."))
+      path)))
+  (set-variable-default-value!
+   (ref-variable-object shell-file-name)
+   (or (get-environment-variable "SHELL") "/bin/sh")))
 
 (define edwin-processes)
 
@@ -81,6 +87,12 @@ Value takes effect when `start-process' is called."
 False means don't delete them until \\[list-processes] is run."
   true
   boolean?)
+
+(define-variable shell-file-name
+  "File name to load inferior shells from.
+Initialized from the SHELL environment variable."
+  ""
+  string?)
 \f
 (define-structure (process
                   (constructor %make-process (subprocess name %buffer)))
@@ -679,7 +691,7 @@ Prefix arg means replace the region with it."
 
 (define (shell-command input-region output-mark directory pty? command)
   (run-synchronous-process input-region output-mark directory pty?
-                          "/bin/sh" "-c" command))
+                          (ref-variable shell-file-name) "-c" command))
 \f
 ;;; These procedures are not specific to the process abstraction.