Closed daxgames closed 6 months ago
~This really falls under the same problem space as #13006 et al. We could add that, sure,~
Wait, no it doesn't. This is actually so simple. Set that variable for terminal itself. So that we can resolve things relative to ourself. brilliant.
I think we were already tracking this in #15379 but I'll motion to use this as the tracking thread instead, since this has a real good idea. Thanks!
The implemented solution in https://github.com/microsoft/terminal/pull/16949:
%WT_SETTINGS_DIR%
or %WT_SETTINGS_PATH%
%WT_SETTINGS_DIR%
because it seems to MOSTLY work.New Config:
Launching the profile:
The paths exist because the shell is configured using "%WT_SETTINGS_DIR%\..\..\init.bat"
and the tab icon is correctly read from "%WT_SETTINGS_DIR%......\icons\cmder_red.ico".
Also why can't this just be a normal env variable like the below that are set in 1.20.x:
Like this:
It's WT_SETTINGS_DIR
😄
(It may not work in the commandline field - we need to investigate that. It should work in any other field in the settings that supports paths.)
See my edited comment above.
Thanks!
Thanks for the quick response and the fix!
I looked at the PR and it went back and forth on %WT_SETTINGS_DIR%
and %WT_SETTINGS_PATH%
. After posting the issue I went to the Release Notes and saw the correct env var but it still throws the icon message. Other than that it all works!
My only other concern is wrapping the icon path with double quotes causes it to fail. Not sure if that would be an issue if the icon were in a path that contained spaces.
Description of the new feature/enhancement
Set an environment variable
WT_FOLDER_PATH
to the folder path that containsWindowsTerminal.exe
. This variable should be set when Windows Terminal launches before the profile is launched.This would be useful for users that run Windows Terminal in portable mode so Windows terminal profiles can be configured with paths relative to the folder wher WIndows Terminal is installed as shown below:
The normal user profile is configured as shown below and works perfectly because the
%CMDER_ROOT%
env variable was set dynamically before launching Windows Terminal.The above configuration does not work when launching as Administrator because the
%CMDER_ROOT%
env variable is not set globally on the system nor in the Administator's personal environment variables. it produces the error below:For completeness sake the icon config being complained about in the error above is below:
Proposed technical implementation details (optional)