Yes.
--
http://www.legacy-2000.com for the *best* OpenVMS system security
solutions that others only claim to be.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM
"Well my son, life is like a beanstalk, isn't it?"
Yes, it is.
I use it for a decade now to restore video attributes or a bad scroll region
(like EDT which doesn't turn it off on exit but sets it to 24 lines which is
bad on DECterms with larger sizes).
$ sy_len = F$LENGTH (node) - 1
$ sy_str = F$EX (0, 1, node) + F$ED (F$EX (1, sy_len, node), "LOWERCASE")
$ us_len = 2
$ us_str = F$EX (0, 1, user) + F$ED (F$EX (1, us_len, user), "LOWERCASE")
$ pr_str = sy_str + "/" + us_str
$ prompt = esc + "(B" + esc + "[4l" + esc + "7" + esc + "[r" + esc + "8"
$ prompt = prompt + esc + "[1m" + pr_str + esc + "[m"
$ IF .NOT. F$GETDVI ("TT", "TT_DECCRT") THEN prompt = pr_str + "$"
$ SET PROMPT = "''prompt' "
So, if typing an exe or similar occur, one return and most/all is ok again.
YMMV
--
Peter "EPLAN" LANGSTOEGER
Network and OpenVMS system specialist
E-mail pe...@langstoeger.at
A-1030 VIENNA AUSTRIA I'm not a pessimist, I'm a realist
That EDT problem was fixed at some point somewhere roughly between VMS
v5.5x and 6.1. Is it broken again?
[Code to assemble escape sequences into the symbol "PROMPT" omitted]
> $ SET PROMPT = "''prompt' "
You can use
$ SET PROMPT = &PROMPT
instead. By using the ampersand in this way you can TYPE or PRINT the
command file without sending the actual raw escape sequences to the
terminal or printer. This may also help when running the command file
with SET VERIFY.
Here's what I use to put the node name in bold in the prompt:
$ ESC :=
$ ESC[0,8] = 27
$ BOLD = ESC + "[1m"
$ UNBOLD = ESC + "[0m"
$ NODE = F$GETSYI("NODENAME")
$ PROMPT_STRING = BOLD + NODE + "$" + UNBOLD + " "
$ SET PROMPT = &PROMPT_STRING
[remainder of quoted material cut]
Disclaimer: JMHO
Alan E. Feldman
Cool. I haven't noticed (for obvious reasons). But I doubt, that it was V5.5.
It must be around V7 as I waited for it many many years to become fixed (and
I did look for known bugs from my list on [almost] every new VMS version).
>[Code to assemble escape sequences into the symbol "PROMPT" omitted]
>
>> $ SET PROMPT = "''prompt' "
>
>You can use
>
> $ SET PROMPT = &PROMPT
>
>instead. By using the ampersand in this way you can TYPE or PRINT the
>command file without sending the actual raw escape sequences to the
>terminal or printer. This may also help when running the command file
>with SET VERIFY.
SET VERIFY has a difference, TYPE/PRINT has not.
And I prefer using the quotes for debugging reasons (in general; but I must
admit, that this example is one of the very few examples to use the ampersand).
$ def = f$envir("DEFAULT")
$ def1 = f$parse(def,,,"DIRECTORY") - "000000" - "][" - "]["- "[" - "]"
$ if def1 .eqs. "" then def1 = f$parse(def,,,"DEVICE")
$ !
$ On = ""
$ ESC[0,8] = 27
$ Off = "''ESC'[0m"
$ if ( lat_terminal .eqs. "FALSE" ) ! DECterm only
$ then
$ On = "''ESC'[33m"
$ if f$priv("SETPRV")
$ then
$ On = "''ESC'[31m"
$ write sys$output "''OSC'2L;*''nodenm'*''ST'"
$ endif
$ else
$ On = "''ESC'[1m"
$ if f$priv("SETPRV") then On = "''ESC'[1m*"
$ endif
$ set prompt="''On'''def1'''Off'_$"
$ exit
$!
Mike
--
---------------------------------------------------------------------
Usual disclaimer: All opinions are mine alone, perhaps not even that.
Mike Rechtman *rech...@tzora.co.il*
Kibbutz Tzor'a. Voice (home): 972-2-9908337
"20% of a job takes 80% of the time, the rest takes another 80%"
---------------------------------------------------------------------
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS d(-)pu s:+>:- a++ C++ U-- L-- W++ N++ K? w--- V+++$
PS+ PE-- t 5? X- tv-- b+ DI+ D-- G e++ h--- r+++ y+++@
------END GEEK CODE BLOCK------
Well, it may not have made it to documentation. And I don't know about
DECterm, but EDT on VMS v6.1 works fine on my SmarTerm except that the
cursor is placed at the bottom of the screen. But that's okay: I still
get my original screen settings back.
> >[Code to assemble escape sequences into the symbol "PROMPT" omitted]
> >
> >> $ SET PROMPT = "''prompt' "
> >
> >You can use
> >
> > $ SET PROMPT = &PROMPT
> >
> >instead. By using the ampersand in this way you can TYPE or PRINT the
> >command file without sending the actual raw escape sequences to the
> >terminal or printer. This may also help when running the command file
> >with SET VERIFY.
>
> SET VERIFY has a difference, TYPE/PRINT has not.
Well, I didn't try it in these specific cases, but in general it is
not a good idea to send escape sequences to terminals or printers. I
have had the "pleasure" of printing some inherited DCL code only to
find the (line) printer get totally messed up, trying to print on the
same region of the paper over and over again (Just what you need: a
scrolling region on a printer!). Only a power cycle would fix it. Of
course I fixed the inherited code so that it wouldn't happen again.
> And I prefer using the quotes for debugging reasons (in general; but I must
Yes, I often do, too.
> admit, that this example is one of the very few examples to use the ampersand).
See
or use
Message-ID: <b096a4ee.02111...@posting.google.com>
to see more uses of the ampersand (warning! url may have wrapped.)
Yes, but don't use it in batch mode - it doesn't just make logfiles look
messy but can screw up printers. And beware Murphy - he will have it
that the one time you need to log in remotely to fix something, the only
terminal emulator you have handy will choke.
--
Paul Sture
Yes. I use the two enable/disable command procedures below to change the
prompt color when I turn on/off privileges (DECterm).
PICARD-# type loc_com:enable.com
$ ! Command File to enable all privileges and change the prompt
$
$ echo := 'F$Verify (0)'
$ Set Noon
$ esc[0,8]=27
$
$ ! Enable Privileges
$
$ old_privs := 'F$Setprv ("all")'
$ node := 'F$Getsyi ("SCSNODE")'
$
$ If "''enable_prompt'" .eqs. ""
$ Then
$ Set Prompt="''esc'[31m''node'-# ''esc'[0m"
$ Else
$ Set Prompt="''enable_prompt'"
$ EndIf
$
$Finished:
$ echo := 'F$Verify (echo)'
PICARD-# type loc_com:disable.com
$ echo := 'F$Verify (0)'
$ Set Noon
$ esc[0,8]=27
$ junk := 'F$Setprv ("NOALL,TMPMBX,SETPRV,NETMBX")'
$ node := 'F$Getsyi ("scsnode")'
$
$ If "''disable_prompt'" .eqs. ""
$ Then
$ Set Prompt="''esc'[34m''node'-$ ''esc'[0m"
$ Else
$ Set Prompt="''disable_prompt'"
$ EndIf
$
$Finished:
$ echo := 'F$Verify (echo)'
---------------------------------------------------------------
Tom Wade | EMail: tee dot wade at eurokom dot ie
EuroKom | X400: g=tom;s=wade;o=eurokom;p=eurokom;
Unit A2 | a=eirmail400;c=ie
Nutgrove Office Park | Tel: +353 (1) 296-9696
Rathfarnham | Fax: +353 (1) 296-9697
Dublin 14 | Disclaimer: This is not a disclaimer
Ireland | Tip: "Friends don't let friends do Unix !"
While we're on the subject of things that should perhaps best be
avoided in prompts, here's another one:
Adding three greater than symbols > in a row to one's prompt can fool
some system monitoring software [which shall not be named here] into
thinking that the node has crashed.
WWWebb
========================
William W. Webb- EMS Operations,
OpenVMS Systems Support
USPS DSSC Annex - 4730 Hargrove Road
Raleigh, NC 27616-2874 919.325.7500x4186
* * * -
--
Barry in Indy
Knock me out to reply
Well, as is often the case, there's a large gap between what CAN be done
and what SHOULD be done.
--
David J. Dachtera
dba DJE Systems
http://www.djesys.com/
Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/