Open alias "wt" have unexpected behavior. #16843

Closed
opened 2026-01-31 05:24:46 +00:00 by claunia · 19 comments
Owner

Originally created by @hungpham3112 on GitHub (Feb 21, 2022).

Windows Terminal version

1.12.220208003-release1.12

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

  1. Using scoop to add windows-terminal from extras bucket
  2. install python use scoop install python
  3. run windows terminal and "wt.exe" in 2 instances.
  4. type python in window terminal and see result
  5. type python in wt.exe and see result

Expected Behavior

Path in wt.exe same like windows terminal.

Actual Behavior

bandicam 2022-02-21 11-54-25-458.zip

You can see in here, because it took 20 mb

Originally created by @hungpham3112 on GitHub (Feb 21, 2022). ### Windows Terminal version 1.12.220208003-release1.12 ### Windows build number 10.0.22000.0 ### Other Software _No response_ ### Steps to reproduce 1. Using `scoop` to add `windows-terminal` from `extras` bucket 2. install python use scoop install python 2. run `windows terminal` and "wt.exe" in 2 instances. 3. type python in `window terminal` and see result 3. type python in `wt.exe` and see result ### Expected Behavior Path in `wt.exe` same like `windows terminal`. ### Actual Behavior [bandicam 2022-02-21 11-54-25-458.zip](https://github.com/microsoft/terminal/files/8106327/bandicam.2022-02-21.11-54-25-458.zip) You can see in here, because it took 20 mb
Author
Owner

@hello-smile6 commented on GitHub (Feb 21, 2022):

#12535 may be related (Crash due to directory being provided as first parameter)

@hello-smile6 commented on GitHub (Feb 21, 2022): #12535 may be related (Crash due to directory being provided as first parameter)
Author
Owner

@hungpham3112 commented on GitHub (Feb 22, 2022):

#12535 may be related (Crash due to directory being provided as first parameter)

I don't know but wt.exe and Window Terminal seems to use the different$env:path

image

On the left wt.exe, on the right Window terminal. So magic

@hungpham3112 commented on GitHub (Feb 22, 2022): > #12535 may be related (Crash due to directory being provided as first parameter) I don't know but `wt.exe` and `Window Terminal` seems to use the different`$env:path` ![image](https://user-images.githubusercontent.com/75968004/155080926-11596af3-701e-4f79-842c-e277f219a824.png) On the left `wt.exe`, on the right `Window terminal`. So magic
Author
Owner

@zadjii-msft commented on GitHub (Feb 22, 2022):

Hmm. So, the path is different when launched via the alias or via the actual start menu shortcut. Tha's quite unexpected. They both seem to have the same settings, so it's not like one launched the unpackaged version and the other launched the packaged version.

I suppose I don't totally know how scoop sets up the app execution alias. Presumably, it doesn't actually set up an alias the same way as the Store install would. Hmm. There's another thread floating around here that's a bit similar. Lemme look that up.

@zadjii-msft commented on GitHub (Feb 22, 2022): Hmm. So, the path is different when launched via the alias or via the actual start menu shortcut. Tha's quite unexpected. They both seem to have the same settings, so it's not like one launched the unpackaged version and the other launched the packaged version. I suppose I don't totally know how `scoop` sets up the app execution alias. Presumably, it doesn't actually set up an alias the same way as the Store install would. Hmm. There's another thread floating around here that's a bit similar. Lemme look that up.
Author
Owner

@zadjii-msft commented on GitHub (Feb 22, 2022):

#11777 was the thread I was thinking of. That doesn't mention installing from scoop though, so that might not be the only cause.

@zadjii-msft commented on GitHub (Feb 22, 2022): #11777 was the thread I was thinking of. That doesn't mention installing from scoop though, so that might not be the only cause.
Author
Owner

@hungpham3112 commented on GitHub (Feb 23, 2022):

#1125 was the thread I was thinking of. I can confirm to you that wt.exe used my old path in 2 month ago, it's not updated. I believe scoop quite clean and not related to this issue. Both wt.exe and Window Terminal share same directory

image

This morning, I checked wt.exe and it can open python but $env:path still stay the same. Is there any update?

@hungpham3112 commented on GitHub (Feb 23, 2022): #1125 was the thread I was thinking of. I can confirm to you that `wt.exe` used my old path in 2 month ago, it's not updated. I believe scoop quite clean and not related to this issue. Both `wt.exe` and `Window Terminal` share same directory ![image](https://user-images.githubusercontent.com/75968004/155242996-410b983d-6232-4998-a4a9-fe35a29dde0c.png) This morning, I checked `wt.exe` and it can open python but `$env:path` still stay the same. Is there any update?
Author
Owner

@zadjii-msft commented on GitHub (Feb 23, 2022):

I'm pretty sure #1125 only applies if you change the environment variables while the Terminal is running. From a cold launch (which it looks like this is), then it should always get a fresh set of variables. And I wouldn't expect different launch mechanisms to have different results. Kinda interesting that the scoop/apps/windows-terminal/current directory isn't on the path...

What happens when you launch wt from the Run Dialog? Do you get the working path, or the broken one?

@zadjii-msft commented on GitHub (Feb 23, 2022): I'm pretty sure #1125 only applies if you change the environment variables while the Terminal is running. From a cold launch (which it looks like this is), then it should always get a fresh set of variables. And I wouldn't expect different launch mechanisms to have different results. Kinda interesting that the `scoop/apps/windows-terminal/current` directory isn't on the path... What happens when you launch `wt` from the Run Dialog? Do you get the working path, or the broken one?
Author
Owner

@hungpham3112 commented on GitHub (Feb 23, 2022):

I'm pretty sure #1125 only applies if you change the environment variables while the Terminal is running. From a cold launch (which it looks like this is), then it should always get a fresh set of variables. And I wouldn't expect different launch mechanisms to have different results. Kinda interesting that the scoop/apps/windows-terminal/current directory isn't on the path...

What happens when you launch wt from the Run Dialog? Do you get the working path, or the broken one?

It said:
image

@hungpham3112 commented on GitHub (Feb 23, 2022): > I'm pretty sure #1125 only applies if you change the environment variables while the Terminal is running. From a cold launch (which it looks like this is), then it should always get a fresh set of variables. And I wouldn't expect different launch mechanisms to have different results. Kinda interesting that the `scoop/apps/windows-terminal/current` directory isn't on the path... > > What happens when you launch `wt` from the Run Dialog? Do you get the working path, or the broken one? It said: ![image](https://user-images.githubusercontent.com/75968004/155345574-fb4ed2cc-6e32-43ba-af5b-d96051a1112e.png)
Author
Owner

@elsaco commented on GitHub (Feb 23, 2022):

scoop is shimming executables. For windows terminal it adds two shims in C:\User\<username>\scoop\shims\ that point to installed app.

wt.shim content:
path = C:\Users\<username>\scoop\apps\windows-terminal\current\wt.exe

and windowsterminal.shim content:
path = C:\Users\<username>\scoop\apps\windows-terminal\current\WindowsTerminal.exe

Sample gcm output:
wt_shim

@elsaco commented on GitHub (Feb 23, 2022): `scoop` is shimming executables. For windows terminal it adds two shims in `C:\User\<username>\scoop\shims\` that point to installed app. `wt.shim` content: `path = C:\Users\<username>\scoop\apps\windows-terminal\current\wt.exe` and ` windowsterminal.shim` content: `path = C:\Users\<username>\scoop\apps\windows-terminal\current\WindowsTerminal.exe` Sample `gcm` output: ![wt_shim](https://user-images.githubusercontent.com/3933920/155359999-eea3b6d5-f63f-4d90-86d0-8527ff6c1ceb.png)
Author
Owner

@zadjii-msft commented on GitHub (Apr 16, 2023):

This might have been fixed by #14999

@zadjii-msft commented on GitHub (Apr 16, 2023): This might have been fixed by #14999
Author
Owner

@zadjii-msft commented on GitHub (Jul 5, 2023):

Hey we pretty aggressively changed how env vars are loaded in 1.18. Could you check if this is fixed in Terminal Preview/?

@zadjii-msft commented on GitHub (Jul 5, 2023): Hey we pretty aggressively changed how env vars are loaded in 1.18. Could you check if this is fixed in Terminal Preview/?
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 9, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 9, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@hungpham3112 commented on GitHub (Jul 9, 2023):

I will take a look and response as soon as I can.

@hungpham3112 commented on GitHub (Jul 9, 2023): I will take a look and response as soon as I can.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Jul 14, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@hungpham3112 commented on GitHub (Aug 2, 2023):

I tested, version 1.18 fixed PATH in wt.exe. Thanks for the hard work.

@hungpham3112 commented on GitHub (Aug 2, 2023): I tested, version 1.18 fixed PATH in `wt.exe`. Thanks for the hard work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16843