LispWorks CAPI Reference Manual > 1 CAPI Reference Entries

NextPrevUpTopContentsIndex

shell-pane

Class
Summary

A pane allowing the user to interact with a subprocess.

Package

capi

Superclasses

interactive-pane

Initargs

:command

The command which is run as a subprocess.

Accessors

shell-pane-command

Description

The class shell-pane creates an editor in which a subprocess runs.

User input is interpreted as input to the subprocess. In particular, when the user enters Return in the last line, the line is sent to the subprocess. The output of the subprocess is displayed in the pane.

The default value of command is nil , which means that the actual command is determined as follows:

On Unix/Linux and Mac OS X, the value of the environment variable ESHELL is used if set, and otherwise the environment variable SHELL is consulted. If that is not set, then /bin/csh ( /bin/sh on SVR4 platforms) is run.

On Microsoft Windows 98/ME, command is run.

On Windows 2000/XP/Vista/Windows 7, cmd is run.

Example

This function emulates user input on pane :

(defun send-keys-to-pane-aux (pane string newline-p)
  (loop for char across string
        do (capi:call-editor pane char))
  (if newline-p
      (capi:call-editor pane #\Return)))

This function trampolines to send-keys-to-pane-aux on the right process:

(defun send-keys-to-pane (pane string newline-p)
  (capi:apply-in-pane-process pane 
                              'send-keys-to-pane-aux
                              pane string newline-p))
 
(setq sp (capi:contain 
          (make-instance 'capi:shell-pane
                         :visible-min-width 
                         '(character 60)
                         :visible-min-height
                         '(character 30))))

This call emulates the user typing dir followed by Return :

(send-keys-to-pane sp "dir" t)

LispWorks CAPI Reference Manual - 21 Dec 2009

NextPrevUpTopContentsIndex