ITERM$
From CometWiki
ITERM$
System variable: ITERM$ Length: 3 Description: The system variable named ITERM$ contains the identification number of the initiating terminal for the current program. This value is a three-byte string in the form "Tnn", where "nn" is a value from "00" to "99". When a program is running in a foreground partition, the value of ITERM$ is identical to TERM$. However, for a program running in a background partition, TERM$ will contain a null value and ITERM$ will contain the identification number of the terminal initiating the background process.