-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MINOR: Environment Variable in CMD Prompt not resolved. #8096
Comments
So here's the weird thing with the PROMPT command - environment variables in it are only expanded when the command is run, not when the prompt is displayed. So when you do: PROMPT %COMPUTERNAME%$g cmd evaluates So I'm betting that your prompt variable literally has |
That is correct and is what I posted above. |
This is likely a side effect of us giving CMD a new environment block. I swear sometimes, this OS is too fragile to write code for. |
This NOT a big deal (very minor IMO), I can just run my prompt manually after opening the COMMAND Prompt windows in WT. Like I said earlier, just wanted to make sure this was not an "oversite". |
Alright, after sitting on this issue for a while I've come to a conclusion. This is technically the same as #7418, but for a different reason. The solution to both is the same, however: we have to do a 3-way merge and expand the environment block in Terminal before we start the next process. Thanks 😄 /dup #7418 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Environment
Steps to reproduce
Launch Command Prompt in WT
Expected behavior
While I have a fairly long (and "crazy") prompt string in my environment settings it seems to do everything right except resolve an environment name (in this case my PC name %ComputerName%).
Current Prompt:
$E[1;33;45m[$D--$T$H$H$H$H$H$H]$S$E[7;33;44m$C$N:$Q$M$H$F$$E[0;34;47m$P$E[0;37;44m$[%ComputerName%]:$S$+$G$S
Prompt should look like this:
[10/29/2020-- 9:38] (P:=\ServerName\Dir1\Dir2)
P:
[MyActualPCName]: >
Actual behavior
I get this (with all the correct colors) but the %ComputerName% is not resolved.
[10/29/2020-- 9:32] (P:=\ServerName\Dir1\Dir2)
P:
[%ComputerName%]: >
The text was updated successfully, but these errors were encountered: