mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2026-08-24 02:34:19 -05:00
fix(pwsh): never output BOM for init scripts
This commit is contained in:
committed by
Jan De Dobbeleer
parent
fefd73a7b5
commit
4a2d9958f1
Vendored
+4
@@ -25,5 +25,9 @@
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.markdownlint": "explicit"
|
||||
}
|
||||
},
|
||||
"files.encoding": "utf8",
|
||||
"[powershell]": {
|
||||
"files.encoding": "utf8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +196,9 @@ func generateScript(env runtime.Environment, feats Features) string {
|
||||
return fmt.Sprintf("echo \"No initialization script available for %s\"", env.Flags().Shell)
|
||||
}
|
||||
|
||||
// Remove UTF-8 BOM if present, as it can cause issues in some shells.
|
||||
script = strings.TrimPrefix(script, "\xef\xbb\xbf")
|
||||
|
||||
init := strings.NewReplacer(
|
||||
"::OMP::", executable,
|
||||
"::SESSION_ID::", cache.SessionID(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# remove any existing dynamic module of OMP
|
||||
# remove any existing dynamic module of OMP
|
||||
if ($null -ne (Get-Module -Name "oh-my-posh-core")) {
|
||||
Remove-Module -Name "oh-my-posh-core" -Force
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user