ARPUS/ce, Version 2.6.2 (03/10/05)    (SCCS 1.11)
_______________________________________________________________________________
 cd <directory>
 "change directory"
 
 DESCRIPTION:
     A ceterm window maintains two current directories, one associated
     with  the  ceterm's EDITOR process and the other associated  with
     the ceterm's SHELL process.

     The  EDITOR's current directory is set when the ceterm session is
     created.   The  initial  current  directory  for  the  EDITOR  is
     determined as follows:
     
     A.  If  the  ceterm  session  was created as part  of  the  login
         process,    the   EDITOR's   current  directory   is   $HOME.

     B.  If  the ceterm session was created from another shell  (i.e.,
         at  the shell prompt and not from the "Command:" prompt), the
         new  ceterm  EDITOR  inherits as its  current  directory  the
         originating SHELL's current directory.

     C.  If the ceterm session was created from another ceterm, cv, or
         ce  window  via the "Command:" prompt, the new ceterm  EDITOR
         inherits  as  its current directory the originating  EDITOR's
         current directory.
     
     The  SHELL's current directory setting follows the same rules  as
     shells running in other environments.

     It  is important to bear in mind that the two 'current directory'
     settings described above can be set to different directories.  As
     an  example  of the problems that may occur, consider the use  of
     mouse  button  3's  default   definition,  which   creates  a  cv
     (read-only)  session on the file that is currently pointed to  by
     the cursor. A normal use of this definition is as follows:
     
     A.  In  a ceterm session, type the 'ls' command, which will  list
         in  the  ceterm's  transcript pad the files that are  in  the
         SHELL's current directory.

     B.  Place  the  cursor  over one of the file names and  click  M3
         (assuming  you  are  using the default M3  definition).   The
         definition  tells ce to copy the word under the cursor into a
         'cv' command and execute that command, causing a cv window on
         that file to appear .
     
     One of three things may happen:
     
     1.  The  'cv'  command  will look in ITS  OWN  current  directory
         (i.e.,  the  EDITOR's current directory) for a file  of  that
         name.   If  the  EDITOR's current directory and  the  SHELL's
         current directory are the same, this will work.

     2.  The  EDITOR  and SHELL have different directories,  but  each
         directory  contains  a file with the name pointed to  by  the
         cursor.   In  this  case the DESIRED file is in  the  SHELL's
         directory  but the VIEWED file is in the EDITOR's  directory.

     3.  The  EDITOR and SHELL have different directories, the SHELL's
         directory contains the file pointed to by the cursor, and the
         EDITOR's directory does not contain it.  In this case ce will
         report a "file not found" message in the ce output window.
     
 SYNCHRONIZING CETERM AND SHELL DIRECTORIES
     One  technique to keep the shell and ceterm directories  pointing
     to  the  same  place  is through the  mechanisms  in  the  prefix
     command.   This  technique  works for the ksh but  not  the  csh.
     Assuming  you use both ceterm's and non-ceterms you could put the
     following in your .profile.

     if [ $TERM = vt100 ]
     then
        PS1="cd \$PWD;title \$PWD
     Unix: "  
     else
        PS1="Unix: "
     fi
     export PS1
     # Note, the above should start in column 1.
     # Also note, The unprintable characters are x'02', To type a x'02'
     # execute Ce command:  kd ^2 er 02 ke
     # This will define CTL/2 to enter a x'02'

     The above will tell the ceterm to change to the current directory
     of  the shell each time a prompt is issued (This is actually very
     fast).   It will also change the window manager titlebar to match
     the current working directory.


     Another  technique to synchronize the ceterm's directory with the
     SHELL's  directory  is to put the following alias in  the  .kshrc
     file in your home directory:

     alias cd=ce_cd
     ce_cd(){
        xdmc "cd `/bin/pwd`; cd $@"
        'cd' ${@-$HOME}
     }

     A more sophisticated version of the above alias would be:

     ce_cd(){
     if [[ -d $@ || x$@ = x ]]; then
       xdmc "cd `/bin/pwd`; cd $@"
       'cd' ${@-$HOME}; pwd
     else
       echo " cant cd -- $@ is not a directory"
     fi
     }
     alias cd=ce_cd


     This  tells  the  ceterm  current  working  directory  to  change
     directories  at  the  same time as the  shell's  current  working
     directory.  To make the .kshrc file active, the following must be
     present in your .profile: ENV=$HOME/.kshrc ;export ENV

     To do the same thing in the .cshrc file use:

     alias cd 'chdir \!*; xdmc "cd $cwd"'


 
 RELATED HELP FILES:
     pn            (Pad Name)             
     ce            (Create Edit)          
     prefix        (Prefix)               
     
     support       (customer support)     

____________________________________________________________________________
  Copyright (c) 2005, Robert Styma Consulting.  All rights reserved.