Question
· 2 hr ago

WebTerminal and the $PRINCIPAL System Variable

Access IRIS Terminal Session using WebTerminal. I noticed that the $P or $PRINCIPAL system variable is defined as //./nul

When logging into Terminal via Management Portal, $P = |TRM||$J

Because of this, we cannot get into Programmers Mode via ^%SYS.PMODE

Any ideas?

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1.2 (Build 574U) Fri Jan 13 2023 15:00:26 EST
Discussion (1)2
Log in or sign up to continue

The $PRINCIPAL system variable contains the ID of the principal device for the current process and operates like $IO. The WebTerminal sessions seem to behave differently because $PRINCIPAL in WebTerminal defaults to a device /./nul, which is a non-terminal device, unable to access terminal-specific features like ^%SYS.PMODE. This contrasts with Management Portal direct terminal sessions where $PRINCIPAL is |TRM||$J, mapping to the terminal feature [1].

The discrepancy arises because WebTerminal emulates a basic I/O environment where $PRINCIPAL is set to redirect I/O operations in a generic way, which limits compatibility with certain programmer-mode features. Unfortunately, this setup affects terminal functionalities reliant on $PRINCIPAL. Addressing it might involve either altering WebTerminal's configuration to simulate terminal I/O or finding alternative approaches for terminal-dependent tasks.

The $PRINCIPAL issue can also interact with how input/output devices are handled through $SYSTEM.Process.ReDirectIO() and similar parameters in WebTerminal [2].

Sources: