oh-my-posh causes SyntaxError: Unexpected non-whitespace character after JSON
Just did the troubleshooting and want some help mitigating. No game could get game info. I saw this line in the Heroic logs which told me nothing
However, in all the logs I also saw fastfetch dump my personal info over and over and over. Turns out Powershell was calling my profile at
C:\Users\myusername\OneDrive\Documents\WindowsPowerShell
, which in addition to fastfetch, included oh-my-posh --init --shell pwsh --config $themePath | Invoke-Expression
I commented out this line and Heroic was immediately able to pull my info correctly.
Is there a way to call Powershell bypassing the profile? Or to set up my profile so that it doesn't trigger when called by Heroic?17 Replies
rival-black•5mo ago
post the whole log, not just the bits you think are relevant
protestant-coralOP•5mo ago
Sorry it's full of PII due to aforementioned fastfetch lol
Let me redact
dependent-tan•5mo ago
I wonder if you can make that fastfetch or that
oh-my-posh
to not output anything, that might be easier maybe?
or maybe only call that line if one of the heroic env variables is not presentprotestant-coralOP•5mo ago
wait actually i forgot i uploaded a redacted version already. dummy https://0x0.st/8sD5.log
https://0x0.st/8sDk.log
at first I thought it was y'all scraping my PC and I was freakin out
fastfetch is running on lines marked
[an absurd amount of personal info redacted]
so y'all are starting a new pwsh process thereprotestant-coralOP•5mo ago
I think there's a way to pass a -NonInteractive flag which I could detect. Per this StackOverflow thread https://stackoverflow.com/questions/9738535/powershell-test-for-noninteractive-mode
Stack Overflow
Powershell test for noninteractive mode
I have a script that may be run manually or may be run by a scheduled task. I need to programmatically determine if I'm running in -noninteractive mode (which is set when run via scheduled task) or
protestant-coralOP•5mo ago
Although I'll admit it's out of my depth
genuinely surprised this hasn't cropped up before
dependent-tan•5mo ago
looks like there's a
-NoProfile
command that can be passed to powershellprotestant-coralOP•5mo ago
or that
dependent-tan•5mo ago
most users don't really know what powershell is, let alone adding a profile
protestant-coralOP•5mo ago
lol fair
so y'all can fix it somewhat easily?
dependent-tan•5mo ago
I don't really use windows at all, so I don't know, maybe it's a matter of adding that
-NoProfile
when calling powershell but I have no way of testing, I'll share this with the rest in case someone knows how to handle thatprotestant-coralOP•5mo ago
Sounds good. I'll just leave my profile commented for now. I'm happy to run tests in the future if it would help.
Will this be an Issue on GitHub? I could track it there
dependent-tan•5mo ago
sure, it will make it easier to find, this can get burried with new support threads added every day
protestant-coralOP•5mo ago
i had a feeling
You want me to submit?
dependent-tan•5mo ago
sure!
protestant-coralOP•5mo ago
on it, boss
protestant-coralOP•5mo ago
GitHub
Heroic calls PowerShell, which uses $PROFILE, which can contain com...
Describe the bug TL;DR: Heroic is using PowerShell on Windows, which calls a user's $PROFILE, and some things (like oh-my-posh) can interfere with Heroic. Please use -NoProfile to prevent this....