atari email archive

a collection of messages sent at Atari from 1983 to 1992.

New prompts

(1 / 1)


Have you ever wished the system would display the current default directory
name somewhere so you could easily tell where you were? Well, now there's
a utility to do just that, compliments of LVR. It'll change the prompt
string to include the current directory spec (no device or node name) to a
maximum specifed length or 32 chars whichever is less. For example, it
makes my prompt string look like:

	[SHEPPERD] K$ 		!for my home directory
	[UTILITIES.COM] K$	!for UTL$COM:

It constructs the "K$" by extracting the first character from the node name (K
for KIM, E for ERNIE, etc.) and sticking on a dollar sign and a space. You can
change that by defining the string you want to the global symbol PROMPT$TAIL.
You can limit the total size of the generated prompt string (so as not to eat up
too much of your command line space) by defining a value less than 32 to the
global symbol PROMPT$MAXLEN. The utility attempts to squeeze the rightmost
directory names into the space allocated and will truncate to the left all that
won't fit but replacing it with one of "[...", "[.." or "[." depending
on how much room there is.

To use this feature, you must execute UTL$COM:PROMPT sometime after you've
logged in (such as in your LOGIN.COM file). Then you must use the set default
commands SD, CD, DC, GOBACK or WHERE (GOSUB and RETURN are obsolete now because
VMS has DCL commands called GOSUB for go to subroutine and RETURN for return
from subroutine). For example, place the following commands in your LOGIN.COM
file: 

	$ CD :== @UTL$COM:CD	!Change Directory (what GOSUB used to do)
	$ SD :== @UTL$COM:SD	!Set Default directory
	$ DC :== @UTL$COM:GOBACK !change directory back
	$ WHE*RE :== @UTL$COM:WHERE !display the set default history
	$ PROMPT$MAXLEN == 20	!only if you want to limit the string length
	$ PROMPT$TAIL == "What now boss? " !only if you want something different
	$ @UTL$COM:PROMPT	!setup the prompt stuff

CD and SD don't require full directory specs to change directories. The
procedures will attempt to figure out what directory you are talking about
by looking around both up and down from the current place in the
directory tree. You also needn't specify the "[]"'s nor dots. For example,

	$ SD TEST

will hunt around in your directory tree looking for a [.TEST] directory.
SD with no argument simply displays the current default directory. CD is
similar to SD except that it remembers the directory from which you came
and the next CD you execute without an argument will return you to the
previously set directory. DC does a GOBACK to the directory you just
returned from. WHERE shows the complete history (stack) of where you've
been and from where you came. Try them, you'll like them. 

Note that if you change your default directory with the DCL command
SET DEFAULT either explicitly or via a command file instead of using the
CD, SD or DC commands, the prompt string will not change so it won't
reflect the current directory. WHERE will always update the prompt string
as will @UTL$COM:PROMPT.

Report trouble to KIM::RAINS.

ds
Message 1 of 1

Jan 08, 1987