microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.58k stars 8.31k forks source link

Add power shell 7 error #6598

Closed chuoke closed 4 years ago

chuoke commented 4 years ago

I tried some methods searched. still not successful. I don't know what I'm missing.

Environment

Windows 10 Professional 1909  x64
Windows Terminal: 1.0.1401.0

Steps to reproduce

I certain the files exist. My profile:

      {
            "guid": "{1a7254b1-b1f5-11ea-89cb-001d090c71d4}",
            "name": "Windows PowerShell 7",
            "commandline": "‪C:\\Apps\\DevTools\\PowerShell7\\7\\pwsh.exe",
            "icon": "‪C:\\Apps\\DevTools\\PowerShell7\\7\\assets\\Powershell_av_colors.ico",
            "hidden": false
        }

Expected behavior

Can open power shell 7 in windows terminal.

Actual behavior

I got two error :

WSLUser commented 4 years ago

That is not a proper path or name. Windows Powershell and PS7 have 2 entirely different profiles and are available by default if you install PS7. Close Windows Terminal, delete the settings.jsonand open Windows Terminal again. This will generate a new settings.json and it will also by default launch PS7.

DHowett commented 4 years ago

This error code means "file not found.".

Can you run the following PowerShell command (outside of terminal)?

Get-FileHash C:\Apps\DevTools\PowerShell7\7\pwsh.exe
DHowett commented 4 years ago

@wsluser People can install powershell wherever they want to. This profile looks entirely valid.

chuoke commented 4 years ago

This error code means "file not found.".

Can you run the following PowerShell command (outside of terminal)?

Get-FileHash C:\Apps\DevTools\PowerShell7\7\pwsh.exe

Thanks first.

I got two same results after I run it in Power shell 7 and old Power shell. power-shell-hash

chuoke commented 4 years ago

@WSLUser Thanks first. I did follow the way you said. but there is nothing the change.

WSLUser commented 4 years ago

Ok yeah, it seems a weird path but if it's valid then it's valid. So even after Terminal does the path generation for you, it fails to launch correctly. I have the 7.0.1 msix installed manually from the Github release to a default location which works in both 1.0 and Preview. I haven't updated to 7.0.2 yet but I wasn't expecting an error like this to occur. What was used to install Powershell?

WSLUser commented 4 years ago

in case its related to this issue: Since I installed the msix and not the msi, I have 2 PS7 profiles, the originsl for msi and another that actually says msix in the name. It was originally launching using the msi profile. While the schema keeps wanting to keep both, I was able to remove the msi profile and leave only the msix in settings. The current PS tab would have a dialog error but a new tab with PS7 would launch just fine.

chuoke commented 4 years ago

I just installed it in the specified directory I want. What a pity If this way is not allowed.

chuoke commented 4 years ago

I noticed weird info from the error message:“‪ C:\Apps\DevTools\PowerShell7\7\pwsh.exe”, in the console, there is spacing before the C. But there have not any spacing in the path of my profile.

DHowett commented 4 years ago

Can you attach a copy of your settings file? You might need to put it in a zip so GitHub doesn’t change the formatting. :)

chuoke commented 4 years ago

settings.zip All are default generated except the Power Shell 7 profile I added.

DHowett commented 4 years ago

Your comment about "spacing" is what tipped me off :smile:

image

That's a "left-to-right embedding" glyph at the beginning of your path!

chuoke commented 4 years ago

That's the point. It works after deleted the invisible spacing. Many hands make light work. Thank you very much.

By the way. I don't know why spacing in the path. But it just happens. So if some other guys have the same problem. You just move your cursor to the weird position and enter DELETE until the quotation mark or you visible mark.

DHowett commented 4 years ago

Glad we figured it out :)