Operating System - OpenVMS
1826055 Members
4417 Online
109690 Solutions
New Discussion

Determining if a Terminal is a DecTerm or not?

 
Jimson_1
Frequent Advisor

Determining if a Terminal is a DecTerm or not?

Hi,

Anyone know of a quick way to determine if a terminal is a DecTerm or Not?

Maybe one of the items for F$GETDVI() but I couldn't see it.

James
11 REPLIES 11
Bart Zorn_1
Trusted Contributor

Re: Determining if a Terminal is a DecTerm or not?

James,

I do not know of a definitive way of deciding about this.

If you are NOT at a FTAn: device, it is not a DECterm.

If you are at a FTAnn: device, you are more or less stuck.

If you issue a SET TERMINAL/INQUIRE command on a DECterm, the device_type will be set to VT300_Series. This can be detected with f$getdvi("sys$command","device_type_name") which will return "VT300 Series", without the underscore.

If you are at a FTAnn: device and it reports being a "VT300 Series" than there is a good chance that your have a DECterm, but this is probably not water tight! And this will only work if you do the SET TERM/INQUIRE first!

HTH!

Bart Zorn
Steven Schweda
Honored Contributor

Re: Determining if a Terminal is a DecTerm or not?

> If you are NOT at a FTAn: device, it is
> not a DECterm.

Really? On my (CDE/"New") desktop, after I
"SET HOST 0", I seem to have a DECterm which
is not an FTAn:

alp $ show terminal
Terminal: _RTA2: Device_Type: VT300_Series Owner: _RTA2:
Username: SMS
Remote Port Info: ALP::SYSTEM
[...]


Or, if I Telnet back in:

alp $ show terminal
Terminal: _TNA79: Device_Type: VT300_Series Owner: _TNA79:
Username: SMS
Remote Port Info: Host: 10.0.0.9 Locn: _RTA1:/SMS
[...]


(SSH _does_ give an FTA, however.)

Presumably, one could send a magic escape
sequence and get a DECterm-specific response,
but, because the "Options"->"General..."
menu offers a wide assortment of possible
"Terminal ID" responses, you probably
shouldn't rely on that result.


An interesting question might be, Why do you
care?


(Send a different magic escape sequence to
have the title bar ask, "IS THIS A DECterm?",
and wait for the victim to answer? If you
don't hear back, he must not have seen the
question. (Of course, _he_ could lie, too.))
Jimson_1
Frequent Advisor

Re: Determining if a Terminal is a DecTerm or not?

Thanks for the responses.

Answering your question, Why do I care? Well, I don't really, but someone else in the office was asking how to do it.

Being a considerate sort of person, I offered to find out, only realising now that its not that straightforward.

Maybe, I'll go and ask him why he cares?

Thanks anyway

JamesP
Steven Schweda
Honored Contributor

Re: Determining if a Terminal is a DecTerm or not?

> Being a considerate sort of person, [...]

Well, I hope you've learned _your_ lesson.
Jimson_1
Frequent Advisor

Re: Determining if a Terminal is a DecTerm or not?

Believe me, never again...
Colin Butcher
Esteemed Contributor

Re: Determining if a Terminal is a DecTerm or not?

Assuming that you mean a DECwindows DECterm, not a physical DEC terminal device (VTxxx) or Powerterm-like terminal emulator, many years ago I wrote some DCL for SYLOGIN that did things like this.


Here's an extract:

$ if f$getdvi("tt:","exists")
$ then
$ this_ttdev = f$getdvi("tt:","fulldevnam") - "_" - ":" - "''this_scsnode'$" - "$''this_alloclass'$"
$ else
$ this_ttdev = ""
$ endif

...


$ !
$ ! Fast login users/sessions (Network users, DECW session manager and
$ ! DECW application detached processes).
$ !
$ if this_username .eqs. "DECNET" .or. -
this_username .eqs. "RSM$CMANAGER" then exit
$ !
$ if f$mode() .eqs. "INTERACTIVE" .and. -
((f$locate("WSA",this_ttdev) .ne. f$length(this_ttdev)) .or. -
(f$locate("MBA",this_ttdev) .ne. f$length(this_ttdev))) then exit
$ !

Might be useful. You could do all sorts of other terminal device type [TXA / WSA / MBA / TA / ...] (as opposed to terminal type [VT300 / Powerterm ...]) stuff if you needed to.

Hope that helps.

Cheers, Colin (http://www.xdelta.co.uk).
Entia non sunt multiplicanda praeter necessitatem (Occam's razor).
Steven Schweda
Honored Contributor

Re: Determining if a Terminal is a DecTerm or not?

> If you are NOT at a FTAn: device, it is
> not a DECterm.

I forgot SET HOST /LAT:

WIMP $ show terminal
Terminal: _LTA1: Device_Type: VT300_Series Owner: SYSTEM
LAT Server/Port: ALP/UIC_000001000004


If you need any more useless information,
feel free to ask.


Looking through the C header files, I did
spot ptd$decterm_set_page_size() in
STARLET.H. Perhaps it can tell a DECterm
from something else. (Novel error status?
No bets.)
Jimson_1
Frequent Advisor

Re: Determining if a Terminal is a DecTerm or not?

Thanks guys for your replies.

Be sure, more useless questions appearing over the coming months....
Jimson_1
Frequent Advisor

Re: Determining if a Terminal is a DecTerm or not?

Thread closed
Galen Tackett
Valued Contributor

Re: Determining if a Terminal is a DecTerm or not?

James,

Useless questions are fine as long as you don't mind useless answers. :-) I have LOTS of those.

Galen
David Jones_21
Trusted Contributor

Re: Determining if a Terminal is a DecTerm or not?

If the terminal device is "FT", then DVI$_LOCKID will return the internal PID of the process controlling the pseudo-terminal, which for DECterm will be a process named DECW$TE_xxxx running image sys$system:decw$terminal.exe. If the FT device is from an SSH session, OTOH, the control process run TCPIP$SSH_SSHD2.EXE.

What isn't quick and easy from DCL, though, is converting the internal PID to the external PID you'd used to actually identify the process. You need to call the kernel routine EXE_STD$CVT_IPID_TO_EPID from an inner mode.
I'm looking for marbles all day long.