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

changing pwsh through terminal->shell->program setting on windows to new powershell causes a panic on launch #23872

Open
SturdyFool10 opened this issue Jan 29, 2025 · 7 comments

Comments

@SturdyFool10
Copy link

SturdyFool10 commented Jan 29, 2025

Describe the bug / provide steps to reproduce it

  1. get zed open for the first time(this works with existing installs, backup your settings.json first cause this corrupts it somehow)
  2. install the latest powershell from the microsoft store
  3. you want to make Zed's terminal use the latest one, add this snippet, you can change the exe path to wherever it actually is, but by default this will be correct:
"terminal": {
    "shell": {
        "program": "C:\\Users\\<username>\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.PowerShell_8wekyb3d8bbwe\\pwsh.exe"
    }
}
  1. close and attempt in horror to relaunch zed
    Actual Behavior: during launch zed panics, causing the window to appear and disappear in a fraction of a second

Expected Behavior: zed to work, and powershell to be the latest-and-greatest within the zed terminal panel

Zed Version and System Specs

Zed: v0.172.0 (Zed Dev 33d1145)
OS: Windows 10.0.26100
Memory: 31.1 GiB
Architecture: x86_64
GPU: NVIDIA GeForce RTX 2080 SUPER || NVIDIA || 566.36

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log
2025-01-29T16:26:30.2533971-07:00 [INFO] ========== starting zed ==========
2025-01-29T16:26:30.4249846-07:00 [INFO] Use Segoe UI as UI font.
2025-01-29T16:26:30.448656-07:00 [INFO] Presentation support: "VK_KHR_win32_surface"
2025-01-29T16:26:30.4488165-07:00 [INFO] Enabling Vulkan Portability
2025-01-29T16:26:30.44893-07:00 [INFO] Enabling color space support
2025-01-29T16:26:30.4687224-07:00 [INFO] Adapter: "NVIDIA GeForce RTX 2080 SUPER"
2025-01-29T16:26:30.4689379-07:00 [INFO] Ray tracing is supported
2025-01-29T16:26:30.5710762-07:00 [INFO] Opening main db
2025-01-29T16:26:30.5766345-07:00 [INFO] Opening main db
2025-01-29T16:26:30.5820672-07:00 [INFO] Using git binary path: None
2025-01-29T16:26:30.6086124-07:00 [INFO] No prompt template overrides directory found at C:\Users\sturd\AppData\Local\Zed\prompt_overrides. Using built-in prompts.
2025-01-29T16:26:30.6121306-07:00 [INFO] extensions updated. loading 9, reloading 0, unloading 0
2025-01-29T16:26:30.6167502-07:00 [INFO] Opening main db
2025-01-29T16:26:30.6207442-07:00 [INFO] set status on client 0: Authenticating
2025-01-29T16:26:30.62117-07:00 [INFO] set status on client 252328: Connecting
2025-01-29T16:26:30.6230895-07:00 [WARN] Requested size 1x1 is outside of surface capabilities
2025-01-29T16:26:30.6231436-07:00 [ERROR] No composite alpha flag for transparency: OPAQUE
2025-01-29T16:26:30.6239199-07:00 [INFO] Using surface present mode MAILBOX
2025-01-29T16:26:30.6263405-07:00 [INFO] Configuring exclusive full screen: false
2025-01-29T16:26:30.6291847-07:00 [WARN] Theme "Material Dark" is using a deprecated style property: scrollbar_thumb.background. Use `scrollbar.thumb.background` instead.
2025-01-29T16:26:30.63453-07:00 [INFO] Creating a descriptor pool for at most 16 sets
2025-01-29T16:26:30.6345853-07:00 [INFO] Creating a descriptor pool for at most 16 sets
2025-01-29T16:26:30.634633-07:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2025-01-29T16:26:30.6364351-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6367305-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6379997-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6382598-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6387501-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6389639-07:00 [INFO] Skip function Some("to_device_position_impl")
2025-01-29T16:26:30.6390092-07:00 [INFO] Skip function Some("to_device_position")
2025-01-29T16:26:30.639053-07:00 [INFO] Skip function Some("to_device_position_transformed")
2025-01-29T16:26:30.639097-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6391904-07:00 [INFO] Skip function Some("blend_color")
2025-01-29T16:26:30.6397747-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6402697-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6405098-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6410665-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6415651-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6419252-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6421213-07:00 [INFO] Skip function Some("to_device_position_impl")
2025-01-29T16:26:30.6421668-07:00 [INFO] Skip function Some("to_device_position")
2025-01-29T16:26:30.6422093-07:00 [INFO] Skip function Some("to_device_position_transformed")
2025-01-29T16:26:30.6422517-07:00 [INFO] Skip function Some("to_tile_position")
2025-01-29T16:26:30.6423574-07:00 [INFO] Skip function Some("blend_color")
2025-01-29T16:26:30.6443564-07:00 [ERROR] No composite alpha flag for transparency: OPAQUE
2025-01-29T16:26:30.6444029-07:00 [INFO] Using surface present mode MAILBOX
2025-01-29T16:26:30.6444392-07:00 [INFO] Retaining current format: Bgra8UnormSrgb
2025-01-29T16:26:30.6444753-07:00 [INFO] Configuring exclusive full screen: false
2025-01-29T16:26:30.6493279-07:00 [INFO] Using GPU: GpuSpecs { is_software_emulated: false, device_name: "NVIDIA GeForce RTX 2080 SUPER", driver_name: "NVIDIA", driver_info: "566.36" }
2025-01-29T16:26:30.6516812-07:00 [ERROR] No composite alpha flag for transparency: OPAQUE
2025-01-29T16:26:30.6517314-07:00 [INFO] Using surface present mode MAILBOX
2025-01-29T16:26:30.6517692-07:00 [INFO] Retaining current format: Bgra8UnormSrgb
2025-01-29T16:26:30.651807-07:00 [INFO] Configuring exclusive full screen: false
2025-01-29T16:26:30.6963614-07:00 [INFO] Opening main db
2025-01-29T16:26:30.6995329-07:00 [INFO] Opening main db
2025-01-29T16:26:30.7007503-07:00 [INFO] Using Windows API for pseudoconsole
2025-01-29T16:26:30.7323267-07:00 [ERROR] error sending request for url (https://api.zed.dev/telemetry/events?)

Caused by:
    0: client error (SendRequest)
    1: connection error
    2
@SturdyFool10
Copy link
Author

I should also note that the settings.json I am using works without the terminal snippet, crashes with it, then goes back to working once I revert it(through deleting the settings.json and replacing it with an old version of it, cause once again, using this setting seems to cause corruption which then causes it to crash after removing the snippet)

@SturdyFool10
Copy link
Author

SturdyFool10 commented Jan 29, 2025

working settings.json

@OnorioCatenacci
Copy link

OnorioCatenacci commented Jan 30, 2025

Hi SF!

For what it's worth this works for me (no crash):

  "terminal": {
    "shell": {
      "program": "c:\\Program Files\\Powershell\\7\\pwsh.exe"
    }
  }

When I start up the terminal it starts pwsh no issue.

A couple of things that may have a bearing on this.

1.) Not running on a VM version of Win11.

2.) The path I've got is significantly shorter than your so it may be a length of path issue (maybe)?

3.) How did I come up with that path? which pwsh at the prompt will tell you where Windows is finding pwsh.exe to run it--that is where it is in the path.

I'm also going to share this on the Discord since it may help others!

Oh and before I forget--Zed Dev 0.172.0 29bfb56

Win 11 Pro 24H2 OS Build 26100.2894

@SturdyFool10
Copy link
Author

SturdyFool10 commented Feb 2, 2025

Hi SF!

For what it's worth this works for me (no crash):

  "terminal": {
    "shell": {
      "program": "c:\\Program Files\\Powershell\\7\\pwsh.exe"
    }
  }

When I start up the terminal it starts pwsh no issue.

A couple of things that may have a bearing on this.

1.) Not running on a VM version of Win11.

2.) The path I've got is significantly shorter than your so it may be a length of path issue (maybe)?

3.) How did I come up with that path? which pwsh at the prompt will tell you where Windows is finding pwsh.exe to run it--that is where it is in the path.

I'm also going to share this on the Discord since it may help others!

Oh and before I forget--Zed Dev 0.172.0 29bfb56

Win 11 Pro 24H2 OS Build 26100.2894

see, I only went to test on a VM because a bare-metal windows install was crashing, and I was able to recreate the crash using the VM, so for what its worth, this doesn't seem to care whether or not its in a VM.

the goal was to see if I could recreate the crash on a blank windows install, also, for what its worth that doesn't look anything like the path my windows store installed my powershell at

@OnorioCatenacci
Copy link

OnorioCatenacci commented Feb 3, 2025

I used which pwsh to find the path to pwsh.exe. I didn't install via the Windows Store and that may be part of it. I can't 100% be sure but I believe I installed pwsh from here: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5 May be worth your while to try copying pwsh from the path you've got to the one I have and see if you can make the terminal work. That would help to isolate whether or not the path was the issue.

@beatbrot
Copy link

beatbrot commented Feb 5, 2025

I was able to narrow the issue down a bit further. I have installed pwsh via the Microsoft Store. Running where.exe pwsh, I get the following output:

C:\Program Files\WindowsApps\Microsoft.PowerShell_7.5.0.0_x64__8wekyb3d8bbwe\pwsh.exe
C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe

When using the first path in my Zed settings, everything works fine. When using the second path, Zed crashes. When viewing the second path in explorer, it also reports a filesize of 0KB. Running busybox's ls -la pwsh.exe, I also can see that it redirects to the first path. So it seems like Zed has some kind of issue with these links.

@OnorioCatenacci
Copy link

Can you tell if the second path is a hard link or a symbolic link? That may have some bearing on the problem since the underlying windows mechanism may be different between one and the other. Just a suggestion, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants