These points I do not understand about the pseudo and environment handling in PyCmd:
Retrieving pseudo env vars whose values do not seem to get used anywhere in PyCmd (nor are their values useful to maintain as env vars for the next user command, like TIME).
Setting env vars with the name of pseudo env vars. What would be an example where this is correct to do, given that pseudo env vars like TIME, DATE, RANDOM are "highly" dynamic? (There are three places in PyCmd.py where os.environ['CD'] gets set.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The main purpose of creating real env-variables to mimic cmd.exe's pseudo-variables is (if I remember correctly) the completion mechanism. Having them in the environment allows for the variable-name completer to support them w/out treating them as a special case (w/out even knowing about them, actually).
I totally agree that this can create some surprises for users, and the completer should rather be updated to add them to the list of available variables. As it is often the case, the current solution was meant as a temporary hack but it stuck for a long time (the fact that few people actually use these pseudo-variables helped).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
These points I do not understand about the pseudo and environment handling in PyCmd:
Retrieving pseudo env vars whose values do not seem to get used anywhere in PyCmd (nor are their values useful to maintain as env vars for the next user command, like TIME).
Setting env vars with the name of pseudo env vars. What would be an example where this is correct to do, given that pseudo env vars like TIME, DATE, RANDOM are "highly" dynamic? (There are three places in PyCmd.py where os.environ['CD'] gets set.)
The main purpose of creating real env-variables to mimic cmd.exe's pseudo-variables is (if I remember correctly) the completion mechanism. Having them in the environment allows for the variable-name completer to support them w/out treating them as a special case (w/out even knowing about them, actually).
I totally agree that this can create some surprises for users, and the completer should rather be updated to add them to the list of available variables. As it is often the case, the current solution was meant as a temporary hack but it stuck for a long time (the fact that few people actually use these pseudo-variables helped).
[08c5cd] cleans out the environment before starting GUI apps
Related
Commit: [08c5cd]