Description
While testing on windows I noticed that the "doskey" macros created with the alias
command persist outside of the resulting rez environment. So if you have a package.py file like:
def commands():
alias('blender', r'"C:\Program Files\Blender Foundation\Blender 3.1\blender.exe"')
Then after doing rez-env blender
I can run blender
and it will launch Blender. Awesome! The problem is that after exiting the rez environment, the 'blender' alias still exists. This was causing some weird problems when testing with multiple versions of software and multiple softwares. Ideally when the rez environment is exited, it should "unalias" any aliases. On windows, this would be doing doskey blender=
to remove the macro.
Environment
- OS windows 10
- Rez version 2.111.3
- Rez python version 3.9.13
To Reproduce
- create a package on windows with an alias in commands
- go into that rez environment using cmd
- exit
- run that alias
Expected behavior
The command should not exist since the rez environment was exited.
Actual behavior
It runs the alias, which can error due to the environment being invalid.