-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
Prompt breaks if you execute a script with strict mode #758
Comments
We've fixes strict mode issues before…seems like something we should just fix. Maybe we should always run tests in strict mode? |
We definitely should fix the strict mode error. Setting strict mode to latest caused 4 failures but not the missing Length error:
FYI, the line numbers are for my Pester v5 port branch. |
Nevermind. Need to set strict mode in the module and yeah, that shows plenty (37) of potential issues. OK, I've fixed the failing Pester tests this caused. @gsscoder Which version of |
BTW I don't think we want to turn this on in the shipping module since user configuration of $global:GitPromptSettings.DefaultPromptSuffix.Text = ' $((Get-History -Count 1).id + 1)$(">" * ($nestedPromptLevel + 1)) ' The above errors because when you first start PowerShell, history is empty so Maybe we only enable this during Pester tests? |
First of all thank you for this very useful and well done project!
If I execute a script with this strict mode enabled:
posh-git prompt breaks:
It seems that strict mode is extended to loaded modules. Do you think it's better to post this issue in PowerShell repo?
Environment: macOS Catalina, PowerShell installd with brew.
Regards,
Giacomo S. S.
The text was updated successfully, but these errors were encountered: