TCC > Variables & Functions > Variables:
Comments (...)
_SHELL is the current shell number. _SHELL will return 0 for a primary shell, or 1 (or higher) for a shell instance started by a parent TCC process (either directly or via a pipe).
Help URL: http://jpsoft.com/help/index.htm?_shell.htm