On Sat, 03 Nov 2012 12:43:26 +0100, Sietse Brouwer <sbbrou...@gmail.com> wrote:

it seems that Ctx [re]defines the system variable HOME on its run;

This is not an answer, but a guess: Could it be that your interactive
shell uses one setting, and the non-interactive shell uses another?

I'm using the windows default shell - cmd.exe;
it is interactive in the manner that you can type a command on the command 
prompt and the command (or a program) is executed.

In Windows, when a process is created, it inherits current system variables.

If you launch a program from cmd.exe (= command line), the program (process) 
inherits all system variables existing in the moment of launching in the 
environment of the session of that cmd.exe.

(Various instances of cmd.exe don't inter-corporate in the point-of-view of 
system variables.)

Moreover, when the launched program changes a system variable, it changes it 
just in its-own scope;
so values of system variables of the calling cmd.exe are not affected.

BTW: I solved the problem a bit "hacky" (and hopefully temporarily, if we'll find a 
better solution): I'm calling "SET HOME.ORG=%HOME%" right before I launch context.exe;
so I can access my previous variable value.

Somewhere inside a Ctx source within a Lua scope I call:

local home = os.getenv("HOME.ORG") or os.getenv("HOME") or "MyUsualHomePath"

It works but it is not "nice" enough.

Best regards,


I'm only guessing here, I don't know much about Windows
administration; I just remember being driven to despair by a similar
'these settings are not used if the shell is not interactive' problem
under Linux.


If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net

Reply via email to