question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell Extension can not start in macOS (M1)

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

When I use PowerShell extension in a MacBook Air (M1), it always says “Loading PowerShell extension is taking longer than expected.”, and it will get error at last.

The log stopped at “Waiting for session file”, and the session file is always missing.

I use brew-installed powershell and VSCode Universal Edition (M1 Edition produces the error too).

PowerShell Version

❯ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

❯ code --version

1.63.2
899d46d82c4c95423fb7e10e68eba52050e30ba3
arm64

Extension Version

❯ code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2021.12.0

Steps to Reproduce

The extension is not started.

Visuals

截屏2022-01-23 03 15 39

Logs

1/23/2022 3:02:52 AM [NORMAL] - Visual Studio Code v1.63.2 64-bit 1/23/2022 3:02:52 AM [NORMAL] - PowerShell Extension v2021.12.0 1/23/2022 3:02:52 AM [NORMAL] - Operating System: MacOS 64-bit 1/23/2022 3:02:52 AM [NORMAL] - Language server starting – 1/23/2022 3:02:52 AM [NORMAL] - PowerShell executable: /usr/local/bin/pwsh 1/23/2022 3:02:52 AM [NORMAL] - PowerShell args: -Login -NoProfile -NonInteractive -EncodedCommand SQBtAHAAbwByAHQALQBNAG8AZAB1AGwAZQAgACcALwBVA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FIAZQBwAGwAIAAtAFMAdABhAHIAdAB1AHAAQgBhAG4AbgBlAHIAIAAnACcAIAAtAEwAbwBnAEwAZQB2AGUAbAAgACcARABpAGEAZwBuAG8AcwB0AGkAYwAnACAALQBMAG8AZwBQAGEAdABoACAAJwAvAFUAcwBlAHIAcwAvAG4AaQBoAGUAYQB2AGUAbgAvAC4AdgBzAGMAbwBkAGUALwBlAHgAdABlAG4AcwBpAG8AbgBzAC8AbQBzAC0AdgBzAGMAbwBkAGUALgBwAG8AdwBlAHIAcwBoAGUAbABsAC0AMgAwADIAMQAuADEAMgAuADAALwBsAG8AZwBzAC8AMQA2ADQAMgA4ADcAOAAxADcAMgAtADIAYwA1AGEAOQA5ADgAYQAtAGIAZgAwADUALQA0ADgANQA5AC0AYQA3ADkAMQAtADIAMwAyADIANAA3AGEAZABhAGQAMgBiADEANgA0ADIAOAA3ADgAMQA0ADIAMwA2ADEALwBFAGQAaQB0AG8AcgBTAGUAcgB2AGkAYwBlAHMALgBsAG8AZwAnACAALQBTAGUAcwBzAGkAbwBuAEQAZQB0AGEAaQBsAHMAUABhAHQAaAAgACcALwBVAHMAZQByAHMALwBuAGkAaABlAGEAdgBlAG4ALwAuAHYAcwBjAG8AZABlAC8AZQB4AHQAZQBuAHMAaQBvAG4AcwAvAG0AcwAtAHYAcwBjAG8AZABlAC4AcABvAHcAZQByAHMAaABlAGwAbAAtADIAMAAyADEALgAxADIALgAwAC8AcwBlAHMAcwBpAG8AbgBzAC8AUABTAEUAUwAtAFYAUwBDAG8AZABlAC0AOAAxADMANQA2AC0ANwA4ADEANQA3ADEAJwAgAC0ARgBlAGEAdAB1AHIAZQBGAGwAYQBnAHMAIABAACgAKQAgAA== 1/23/2022 3:02:52 AM [NORMAL] - PowerShell Editor Services args: Import-Module ‘/Users/niheaven/.vscode/extensions/ms-vscode.powershell-2021.12.0/modules/PowerShellEditorServices/PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2021.12.0’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘/Users/niheaven/.vscode/extensions/ms-vscode.powershell-2021.12.0/modules’ -EnableConsoleRepl -StartupBanner ‘’ -LogLevel ‘Diagnostic’ -LogPath ‘/Users/niheaven/.vscode/extensions/ms-vscode.powershell-2021.12.0/logs/1642878172-2c5a998a-bf05-4859-a791-232247adad2b1642878142361/EditorServices.log’ -SessionDetailsPath ‘/Users/niheaven/.vscode/extensions/ms-vscode.powershell-2021.12.0/sessions/PSES-VSCode-81356-781571’ -FeatureFlags @() 1/23/2022 3:02:52 AM [NORMAL] - pwsh started. 1/23/2022 3:02:52 AM [NORMAL] - Waiting for session file 1/23/2022 3:06:53 AM [NORMAL] - Timed out waiting for session file to appear. 1/23/2022 3:06:53 AM [NORMAL] - Language server startup failed. 1/23/2022 3:06:53 AM [ERROR] - The language service could not be started: 1/23/2022 3:06:53 AM [ERROR] - Error: Timed out waiting for session file to appear.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
niheavencommented, Jan 26, 2022

I just remove $PROFILE.CurrentUserAllHosts (which contains brew and starship startup code), remove powershell in brew, remove VSCode app, and reinstall VSCode, powershell, and restore $PROFILE.CurrentUserAllHosts, the extension works 😄

I don’t know why, but the issue solved… Thanks you guys, I’ll reopen it when it occurs again (hope not).

0reactions
msftbot[bot]commented, Mar 28, 2022

Thank you for your comment, but please note that this issue has been closed for over a week. For better visibility, consider opening a new issue with a link to this instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language server fails to start in macOS · Issue #3898 - GitHub
I have read the troubleshooting guide. I am sure this issue is with the extension itself and does not reproduce in a standalone...
Read more >
Installing PowerShell on macOS - Microsoft Learn
If the brew command is not found, you need to install Homebrew ... Starting with version 7.2, PowerShell supports the Apple M1 processor....
Read more >
Can't install PowerShell Pro Tools for vscode on Mac?
I want to try out PowerShell Tools but I can't seem to get it working, when I install it on ... vsCode extension...
Read more >
Learn PowerShell on MacBook M1 - is it possible? - Reddit
Hi guys, I'm wondering if I should start learning PowerShell on my MacBook M1 or should I get Windows laptop? Are they any...
Read more >
a program that works like Powershell ISE for Mac OS?
If you don't want to use some "powershell port", the best thing IMHO is to rewrite it into a macOS-compatible script, like bash...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found