volatile environment

Oct 18, 2008
273
1
#1
I'm not sure if this is a bug.

In my tcstart.btm file, I set a volatile environment variable like this:

set /e /v foo=bar

When my PC starts up, I have tcc in the startup folder. once the system starts
and is settled, I then start tcmd from the quick start menu. I can see while
(tab) tcc is starting it takes the path in tcstart where it finds the FOO
variable via

if defined foo .....

I was making some changes and remove tcc from the startup folder, and would then
just started tcmd from quick start. when the first tcc tab was created I notice
that tcstart took the path were FOO was NOT defined, defined it and set it in
volatile and environment.

I then noticed that the next tcc tab I created took the path in tcstart were FOO
did not exist. I thought I was missing something so, I modified tcstart and
added

set /v

Before testing if FOO was defined. I could see from the output of set /v that
FOO was in the list, but the next line in the bat file was

iff not defined FOO ...

The bat file followed the path as if FOO did not exist.

So, by the time tcstart is executing, has TCC loaded up all the defined
Environment variables from

HKLM\System\CurrentControlSet\Control\Session Manager\Environment,
HKCU\Environment, and HKCU\Volatile Environment
 
#2
Like all programs, TCC gets it's environment from its parent (it doesn't "load" any variables).

If I understand you correctly ...

You started without the FOO variable and then started TCMD; TCMD had no FOO variable. Then, in TCC, you set (/v /e) FOO, so it went into the registry and into the current TCC's environment, but not into TCMD's environment. TCMD started the next TCC (tab) so that TCC got the same environment (from TCMD, without FOO) that the first TCC got.

I'm not sure if this is a bug.

In my tcstart.btm file, I set a volatile environment variable like this:

set /e /v foo=bar

When my PC starts up, I have tcc in the startup folder. once the system starts
and is settled, I then start tcmd from the quick start menu. I can see while
(tab) tcc is starting it takes the path in tcstart where it finds the FOO
variable via

if defined foo .....

I was making some changes and remove tcc from the startup folder, and would then
just started tcmd from quick start. when the first tcc tab was created I notice
that tcstart took the path were FOO was NOT defined, defined it and set it in
volatile and environment.

I then noticed that the next tcc tab I created took the path in tcstart were FOO
did not exist. I thought I was missing something so, I modified tcstart and
added

set /v

Before testing if FOO was defined. I could see from the output of set /v that
FOO was in the list, but the next line in the bat file was

iff not defined FOO ...

The bat file followed the path as if FOO did not exist.

So, by the time tcstart is executing, has TCC loaded up all the defined
Environment variables from

HKLM\System\CurrentControlSet\Control\Session Manager\Environment,
HKCU\Environment, and HKCU\Volatile Environment
 
#3
Like all programs, TCC gets it's environment from its parent (it doesn't "load" any variables).

If I understand you correctly ...

You started without the FOO variable and then started TCMD; TCMD had no FOO variable. Then, in TCC, you set (/v /e) FOO, so it went into the registry and into the current TCC's environment, but not into TCMD's environment. TCMD started the next TCC (tab) so that TCC got the same environment (from TCMD, without FOO) that the first TCC got.
If that was the correct analysis, you can change that behavior by checking "Update environment on system change" on the Advanced tab of TCMD's configuration. Then TCMD will hear about the /v-change that TCC made (because TCC announces it to everyone) and add FOO to its own environment. Then new tabs will get it (from TCMD).
 
Oct 18, 2008
273
1
#4
Like all programs, TCC gets it's environment from its parent (it doesn't "load" any variables).

If I understand you correctly ...

You started without the FOO variable and then started TCMD; TCMD had no FOO variable. Then, in TCC, you set (/v /e) FOO, so it went into the registry and into the current TCC's environment, but not into TCMD's environment. TCMD started the next TCC (tab) so that TCC got the same environment (from TCMD, without FOO) that the first TCC got.
Yes, that is the sequence -- the question is after the set /v foo why when I added a new tcc tab there was no
"foo", but the set /v shows foo in the list? In addition, I opened a cmd.exe outside of tcmd and foo was there?
 
Oct 18, 2008
273
1
#5
If that was the correct analysis, you can change that behavior by checking "Update environment on system change" on the Advanced tab of TCMD's configuration. Then TCMD will hear about the /v-change that TCC made (because TCC announces it to everyone) and add FOO to its own environment. Then new tabs will get it (from TCMD).
OK -- I will give that a try
 
#6
Yes, that is the sequence -- the question is after the set /v foo why when I added a new tcc tab there was no
"foo", but the set /v shows foo in the list? In addition, I opened a cmd.exe outside of tcmd and foo was there?
Because TCMD (which doesn't know about FOO) is starting TCC and giving that TCC its (TCMD's) environment.