Skip to content
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

Open alias "wt" have unexpected behavior. #12545

Closed
hungpham3112 opened this issue Feb 21, 2022 · 19 comments
Closed

Open alias "wt" have unexpected behavior. #12545

hungpham3112 opened this issue Feb 21, 2022 · 19 comments
Labels
Culprit-Centennial Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@hungpham3112
Copy link

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

@hungpham3112 hungpham3112 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Feb 21, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 21, 2022
@hello-smile6

This comment was marked as off-topic.

@hungpham3112
Copy link
Author

hungpham3112 commented 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

@zadjii-msft
Copy link
Member

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
Copy link
Member

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

@hungpham3112
Copy link
Author

hungpham3112 commented 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?

@zadjii-msft
Copy link
Member

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 zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 23, 2022
@hungpham3112
Copy link
Author

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 23, 2022
@elsaco
Copy link

elsaco commented 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

@zadjii-msft
Copy link
Member

This might have been fixed by #14999

@zadjii-msft
Copy link
Member

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

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jul 5, 2023
@microsoft-github-policy-service
Copy link
Contributor

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.

@hungpham3112
Copy link
Author

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

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jul 9, 2023
@DHowett DHowett added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 10, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jul 14, 2023
@microsoft-github-policy-service
Copy link
Contributor

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.

5 similar comments
@microsoft-github-policy-service
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

@hungpham3112
Copy link
Author

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

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Culprit-Centennial Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants