From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  5-DEC-1989 21:01
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Re: VMS prompts

Received: From UCBVAX.BERKELEY.EDU by GIZMO.SRI.COM with TCP; Tue,  5 DEC 89 15:44:10 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.40)
	id AA07904; Tue, 5 Dec 89 15:32:25 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 5 Dec 89 22:30:45 GMT
From: astroatc!chrisc@speedy.wisc.edu  (Chris Czerwinski)
Organization: Astronautics Technology Cntr, Madison, WI
Subject: Re: VMS prompts
Message-Id: <2924@astroatc.UUCP>
References: <3263@jarthur.Claremont.EDU>, <55@gollum.twg.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

In article <55@gollum.twg.com> warner@twg.com (Warner Losh) writes:
>In article <3263@jarthur.Claremont.EDU> jmerrill@jarthur.Claremont.EDU (Jason Merrill) writes:

...a bunch of bogus stuff skipped....

>>2) Is there any way to bypass DCL's 32-character limit on prompts?  I can't 
>>   go very deep into my directory tree before DCL refuses to accept the new
>>   prompt and simply doesn't change it.
>
>NO.  The string is stored into a section of memory that has stuff
>before it (the string length) and stuff after it.  So the limit is
>"hard" unless you happen to have complete sources to VMS laying around
>and use them to recompile the entire world. 

Haha, I think. 

>
>Bonus hint: If you want to change the prompt from inside your program,
>but don't want to muck about with CMKRNL routines (more fun, but it
>makes most sysadmins very nervous), then you can do a LIB$DO_COMMAND
>('SET PROMPT="foo"') command as the last command in your program.
>
>--

Thanks Warner for that most amusing little story. Now for rest of the
story. Why settle for just a simple little prompt that displays you home
directory. Wouldn't it be nice to know your pwd all the time? Well here you
go...a YACD that will perform closely to the UNIX cd. It will also perform
commands like cd .. to move up one directory and cd (with no parameters) to
return you home. We all know that the prompt is limited to 32 characters,
so if the directory > 32 (actually 30) I chop off the excess and display
the last part. This way you at least know the cwd.
>-- 

$ if p1 .eqs. ".." then  p1 = "[-]"
$ if p1 .eqs. "" then set def SYS$LOGIN
$ if p1 .nes. "" then set def 'p1'
$cwd = f$directory()
$if f$length(cwd) .gt. 30 then cwd = f$extract(f$lenght(cwd)-30,30,cwd)
$cwd = cwd + ":"
$set prompt='cwd' 
$exit

BTW, whoever sent that previous YACD, WHY IN THE HELL DID YOU GO THROUGH
ALL THE TROUBLE OF READING EVERYTHING LETTER BY LETTER!!! Very confusing.
 
                         Astronautics Corporation of America              
             __                    __
            /  ' /       *        /  '                 *         /   *
           /    /_  __  , _      /   __  _  __  , , __, __  _   /_/ ,
          (____/ /_/ (_/_/_)_   (_____/_(<_/ (_/_/_/ /_/ /_/_)_/ \_/__
          Chris Czerwinski          /| Quality Assurance
          <chrisc@astroatc>    	   |/  ACA - Corporate Headquarters

