How to? Global variable set /v

Oct 18, 2008
273
1
#1
Hello -- Is this by design .... I issued the the command

set /v foo=%_date %_time

it a tabbed tcc window running under tcmd

I then created a 2nd window and the variable "foo" is not defined -- is this by defined ?

create "foo" outside of tcmd, each created tab'ed window had "foo" defined

thanks

fpe
 
#3
I think it is by design. Your second tab got its environment from its parent, TCMD, and TCMD got its environment before you "set /v foo ...".
Maybe I was wrong about that. Your experiment works here. Start TCMD ... in the one (default) tab, "SET /V zzz=xxx" ... start a new tab ... and I find that zzz=xxx. I think you need to ...

Options ... TCMD ... Advanced ... check "Update Environment on System Change"
 

rconn

Administrator
Staff member
May 14, 2008
10,621
97
#4
TCC sessions get their environment from their parent. If TCC is in a tab window, the parent is TCMD, not the Windows shell, so updating variables in the shell won't have any effect until TCMD is restarted.

If you go to the Options menu in TCMD and select "Configure Take Command / Advanced", you can select the "Update Environment on System Change" option to have TCMD's environment automatically updated.