scottmckendry / Windots

My personal "Windows-friendly" dotfiles.
https://scottmckendry.tech/windots
MIT License
277 stars 24 forks source link

PowerShell Error #11

Closed MarkusPriska closed 2 months ago

MarkusPriska commented 2 months ago

I get the following error:

At C:\Users\MarkusPriska\Documents\WindowsPowerShell\profile.ps1:359 char:29
+     $gitUpdates = git fetch && git status
+                             ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : InvalidEndOfLine

When i launch PowerShell version 7.4.3

scottmckendry commented 2 months ago

Can you run $PSVersionTable after you get the error? Weird that PS7 is sourcing its profile from the WindowsPowershell folder.

I have a sneaking suspicion that this is PS5 😉

MarkusPriska commented 2 months ago

The problem i have is that powershell runs but looks a bit funny: image

But then i run nvim from the WezTerm terminal:

image

I keep getting weird error after weird error indicating something with the powershell

scottmckendry commented 2 months ago

I'm not sure what you mean by "looks weird"... if you mean the font, I agree. I tried a bunch of different fonts and font weights and found the JetBrains Mono looked best.

Undo the font changes you made here; I think it will look much better.

The supermaven error, I'm not so sure about... it's not a plugin I use so I'm probably not going to be a huge help here. I'm assuming vim.opt.shell is still set to pwsh?

Looking at the line where the error is coming from, it's trying to run curl - this will be using whatever shell is set in Neovim: https://github.com/supermaven-inc/supermaven-nvim/blob/d71257f431e190d9236d7f30da4c2d659389e91f/lua/supermaven-nvim/binary/binary_fetcher.lua#L65

So it appears to me that for whatever reason, neovim is using powershell instead of pwsh.

If that's not the case, you can try deleting the profile.ps1 from Documents\WindowsPowershell to see if that makes any difference.

MarkusPriska commented 2 months ago

Deleting the entire folder Documents\WindowsPowershell worked! Supermaven loaded correctly! Thanks!

Do you have any idea as to why this was caused?

As to why i wrote my terminal looked weird is beacuse when i run it on my home desktop the terminal has more text saying: "~ with v3.12.0"

scottmckendry commented 2 months ago

Do you have any idea as to why this was caused?

My first guess would be that setup.ps1 was run on PS5 at some point and created a symlinked profile that has compatibility problems.

I'll add a #requires statement at the top of this script so it doesn't happen in future installs.

As to why i wrote my terminal looked weird is beacuse when i run it on my home desktop the terminal has more text saying: "~ with v3.12.0"

This is most likely Starship picking up on specific files in your home directory.

You can run starship explain to see what's causing it.

MarkusPriska commented 2 months ago

Thanks for the help! Love using your config and setup!