rnmst1@cisunx.UUCP (Mingo) (04/03/88)
I am accustomed to having the current time as my prompt using the extended prompt facilities of tcsh, and was wondering if it was possible if I could have something similar set up on VMS. I realise that it would have to be done something like the following command procedure: $! A procedure to set the prompt to the current time. $! $ set noon $ esc[0,8] = 27 $ loop: $ prompt = esc + "[7m" + f$extract(0,5,f$fao("!%T",0)) + esc + "[m" $ read/prompt="''prompt' " sys$output line $ spawn/nolog 'line' $ goto loop The problems are 1) this procedure has to keep running all the time, and 2) it has to spawn processes all the time. That's because it couldn't do some things like MAIL or PHONE. Is there a better way to set a VMS prompt to the current time? Thanks ahead of time, Mingo -- | Mingo, | ...!pitt!cisunx!rnmst1 | I bet I | |University| rnmst1%unix.cis.pittsburgh.edu@vb.cc.cmu.edu | can eat more | | of | RNMST1%VMS.CIS.PITTSBURGH.EDU@VB.CC.CMU.EDU | doughnuts | |Pittsburgh| RNMST1@PITTVMS.BITNET | than you. |
PJS@NAIF.JPL.NASA.GOV (Peter Scott) (04/14/88)
I notice that no-one yet has submitted a solution to the problem that sets the prompt without running a command procedure 'shell'. I wanted a more unobtrusive solution some time ago, and experimented with a sub-process that would modify the prompt string in my process's TT_UCB. Unfortunately, I couldn't find all the internals I needed, even after hours of plowing through the fiches, and besides, I've always crashed the machine when I've tried CHMK before, which this seems to require. However, there are some people on this list who are capable of programming this; anyone care to take up the challenge? Peter Scott (pjs%grouch@jpl-mil.jpl.nasa.gov)
JOE@FHCRCVAX.BITNET (Joe Meadows) (04/19/88)
>I notice that no-one yet has submitted a solution to the problem that >sets the prompt without running a command procedure 'shell'. I wanted >a more unobtrusive solution some time ago, and experimented with a >sub-process that would modify the prompt string in my process's TT_UCB. >Unfortunately, I couldn't find all the internals I needed, even after >hours of plowing through the fiches, and besides, I've always crashed >the machine when I've tried CHMK before, which this seems to require. >However, there are some people on this list who are capable of programming >this; anyone care to take up the challenge? Peter, If I wasn't doing several other things I'd take a stab at it. But, I think I would approach it a little differently.. Why waste a subprocess for such a little thing? Patch DCL. Or, jump into supervisor mode and grab some memory, put in a routine to set the prompt, and set up a repeating schdwk to call this routine.. Anyway, I'd approach it from DCL rather from the terminal drivers point of view. Cheers, Joe Meadows Jr. bitnet - JOE@FHCRCVAX arpa - JOE%FHCRCVAX.BITNET@OLY.ACS.WASHINGTON.EDU -------
PJS@NAIF.JPL.NASA.GOV (Peter Scott) (05/18/88)
As a matter of a fact I did receive a perfectly good solution from Eric Wentz that didn't involve patching DCL (often frowned upon by system managers). He sent me a program called NEW_PROMPT that sets a process's prompt given a PID. I modified it slightly and call it from a subprocess that sets priority to 1 and wakes up every 10 seconds. Unfortunately I don't have Eric's network address (got swept up with the headers when I stripped them off), but if anyone wants the program, if Eric says it's okay, I can mail it to you. Looks like a nice piece of work. Peter Scott (pjs%grouch@jpl-mil.jpl.nasa.gov)