TCC passing expanded envvar to children?

#1
TITLEPROMPT in permanently in the /S(ystem) environment. Below, in TCC, TITLEPROMPT is set correctly. I start PowerPro. In PowerPro's environment, TITLEPROMPT has been expanded. It doesn't happen when I start another version of TCC. But, then again, only TCC knows how to expand the variables in TITLEPROMPT. I have no idea what's going on.

Code:
v:\> set titleprompt
%[_4VER].%[_BUILD]$s$s[%_PID]$s$s$p

v:\> start l:\PowerPro\powerpro.exe

v:\> echo %@pset[%@pid[powerpro.exe],titleprompt]
21.01.52$s$s[2112]$s$s$p
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,570
46
Albuquerque, NM
prospero.unm.edu
#2
How do you know that it is expanded in PowerPro's environment? I think that @PSET is returning the original value, which TCC's variable expansion then further expands before passing it on to ECHO. Try it with CMD.EXE instead of PowerPro; you can use SET to examine CMD's environment.
 
#3
How do you know that it is expanded in PowerPro's environment? I think that @PSET is returning the original value, which TCC's variable expansion then further expands before passing it on to ECHO. Try it with CMD.EXE instead of PowerPro; you can use SET to examine CMD's environment.
Yes, you're right (how dumb of me!). But something very strange happened last night. My login script, which is run by TCCv13, failed and didn't start PowerPro. So I manually started PowerPro using TCCv20. After that I noticed that all versions of TCC (back to v11), when started from a PowerPro list, opened with the v20 TITLEPROMPT.

I just repeated that experiment three times and each time, TCCv20 gave PowerPro the expanded TITLEPROMPT. Today I verified it by looking at PowerPro's environment with ProcessExplorer.

upload_2017-9-26_11-16-59.png

And, yes, it does it with CMD also.

upload_2017-9-26_11-24-40.png