Code of Conduct
What happened?
When using the documented method of including a posh-git prompt in oh-my-posh (https://ohmyposh.dev/docs/segments/scm/git#posh-git) in a left-aligned segment, causes the subsequent right-aligned segment to wrap to the next line. This is presumably because the number of spaces left available for the console width is overestimated.
Note that using any other environment variable in the text template does not cause this issue, only the dynamic POSH_GIT_STRING environment variable is exhibiting the problem.
Based on information found in the linked documentation, add the following to profile:
$env:POSH_GIT_ENABLED = $true
Import-Module posh-git
function Set-PoshGitStatus {
$global:GitStatus = Get-GitStatus
$env:POSH_GIT_STRING = Write-GitStatus -Status $global:GitStatus
}
New-Alias -Name 'Set-PoshContext' -Value 'Set-PoshGitStatus' -Scope Global -Force
An example of the result:

Theme
Customized based off of negligible, replace the git segment with:
{
"template":"{{ if .Env.POSH_GIT_STRING }} {{ .Env.POSH_GIT_STRING }} {{ end }}",
"type": "text",
"style": "plain"
}
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
Segments:
ConsoleTitle(false) - 0 ms
Os(true) - 0 ms
Path(true) - 1 ms
Text(true) - 0 ms
Root(false) - 0 ms
Dart(false) - 0 ms
Node(true) - 38 ms
Python(false) - 5 ms
Battery(false) - 1 ms
Time(true) - 0 ms
Status(true) - 0 ms
Run duration: 43.0336ms
Cache path: C:\Users\Danny\AppData\Local\oh-my-posh
Config path: C:\Users\Danny\OneDrive\custom.omp.json
Logs:
[DEBUG] 18:43:33.576 command.go:execute:989 → debug mode enabled
[DEBUG] 18:43:33.576 debug.go:40 → config set using POSH_THEME: C:\Users\Danny\OneDrive\custom.omp.json
[TRACE] 18:43:33.576 debug.go() - 574.2µs
[TRACE] 18:43:33.577 load.go:Load() - 525.3µs
[TRACE] 18:43:33.577 debug.go() - 525.3µs
[DEBUG] 18:43:33.577 debug.go:52 → plain mode enabled
[TRACE] 18:43:33.577 terminal.go() - 0s
[DEBUG] 18:43:33.577 terminal.go:59 → loading cache file: C:\Users\Danny\AppData\Local\oh-my-posh\omp.cache
[DEBUG] 18:43:33.577 terminal.go:59 → loading cache key: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/CascadiaCode.zip
[DEBUG] 18:43:33.577 terminal.go:59 → loading cache key: upgrade_check
[DEBUG] 18:43:33.577 terminal.go:59 → loading cache key: font_list_cache
[TRACE] 18:43:33.577 terminal.go(C:\Users\Danny\AppData\Local\oh-my-posh\omp.cache) - 524.1µs
[TRACE] 18:43:33.577 terminal.go() - 0s
[DEBUG] 18:43:33.577 terminal.go:59 → loading cache file: C:\Users\Danny\AppData\Local\oh-my-posh\omp.cache.abdbd0bc-4b85-4c93-b976-514b10dbfe41
[DEBUG] 18:43:33.577 terminal.go:59 → loading cache key: prompt_count_cache
[TRACE] 18:43:33.577 terminal.go(C:\Users\Danny\AppData\Local\oh-my-posh\omp.cache.abdbd0bc-4b85-4c93-b976-514b10dbfe41) - 0s
[TRACE] 18:43:33.577 terminal.go:Init() - 0s
[TRACE] 18:43:33.577 terminal.go() - 0s
[DEBUG] 18:43:33.577 terminal.go:Init:67 → C:\HigherLMS\lms.ui
[TRACE] 18:43:33.577 terminal.go:Init() - 0s
[TRACE] 18:43:33.577 debug.go() - 524.1µs
[TRACE] 18:43:33.577 init.go:Init() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[DEBUG] 18:43:33.577 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[DEBUG] 18:43:33.577 cache.go:loadCache:60 → Danny
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[DEBUG] 18:43:33.577 cache.go:loadCache:61 → DM2
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[TRACE] 18:43:33.577 cache.go:loadCache() - 0s
[DEBUG] 18:43:33.577 cache.go:loadCache:71 → NO DATA
[TRACE] 18:43:33.577 cache.go:loadCache(SHLVL) - 0s
[DEBUG] 18:43:33.577 debug.go:61 → terminal program: Windows Terminal
[DEBUG] 18:43:33.577 debug.go:61 → terminal shell: shell
[DEBUG] 18:43:33.577 config.go:MakeColors:58 → NO DATA
[TRACE] 18:43:33.577 config.go:MakeColors(OMP_CACHE_DISABLED) - 0s
[TRACE] 18:43:33.577 colors_windows.go:GetAccentColor(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[DEBUG] 18:43:33.577 colors_windows.go:GetAccentColor:19 → ColorizationColor(DWORD): 0xC4007AD6
[TRACE] 18:43:33.577 colors.go:SetAccentColor() - 0s
[TRACE] 18:43:33.577 colors.go:MakeColors() - 0s
[TRACE] 18:43:33.577 debug.go:PrintDebug() - 0s
[DEBUG] 18:43:33.577 debug.go:PrintDebug:16 → 7.4.6
[TRACE] 18:43:33.577 debug.go:PrintDebug(POSH_SHELL_VERSION) - 0s
[DEBUG] 18:43:33.577 debug.go:72 → segment: Title
[TRACE] 18:43:33.577 engine.go:getTitleTemplateText() - 0s
[TRACE] 18:43:33.577 primary.go:needsPrimaryRightPrompt() - 0s
[DEBUG] 18:43:33.577 terminal.go:CursorPosition:583 → 30
[TRACE] 18:43:33.577 terminal.go:CursorPosition(POSH_CURSOR_LINE) - 0s
[DEBUG] 18:43:33.577 terminal.go:CursorPosition:587 → 1
[TRACE] 18:43:33.577 terminal.go:CursorPosition(POSH_CURSOR_COLUMN) - 0s
[TRACE] 18:43:33.577 primary.go:writePrimaryPrompt() - 0s
[TRACE] 18:43:33.577 primary.go:writePrimaryPrompt() - 0s
[TRACE] 18:43:33.578 segment.go:Execute() - 0s
[DEBUG] 18:43:33.578 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.578 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.578 segment.go:Execute:110 → segment: Text
[DEBUG] 18:43:33.578 segment.go:Execute:112 → no toggles found
[TRACE] 18:43:33.578 segment.go:Execute() - 0s
[DEBUG] 18:43:33.578 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.578 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.578 segment.go:Execute:110 → segment: Os
[DEBUG] 18:43:33.578 segment.go:Execute:112 → no toggles found
[TRACE] 18:43:33.578 os.go:Enabled() - 0s
[TRACE] 18:43:33.578 segment.go:Execute() - 0s
[DEBUG] 18:43:33.578 os.go:Enabled:33 →
[DEBUG] 18:43:33.578 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.578 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.578 segment.go:Execute:110 → segment: Path
[DEBUG] 18:43:33.578 segment.go:Execute:112 → no toggles found
[DEBUG] 18:43:33.578 path.go:147 → display_cygpath: false
[TRACE] 18:43:33.578 path.go:setPaths() - 0s
[TRACE] 18:43:33.578 path.go:setPaths() - 0s
[TRACE] 18:43:33.578 path.go:setPaths() - 0s
[TRACE] 18:43:33.578 path.go:setPaths() - 0s
[TRACE] 18:43:33.578 path.go:parsePath() - 0s
[DEBUG] 18:43:33.579 path.go:setMappedLocations:557 → mapped_locations_enabled: true
[DEBUG] 18:43:33.579 path.go:setMappedLocations:558 →
[DEBUG] 18:43:33.579 path.go:setMappedLocations:559 →
[DEBUG] 18:43:33.579 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.579 clean.go:Clean() - 0s
[TRACE] 18:43:33.579 path.go:normalize() - 0s
[DEBUG] 18:43:33.579 path.go:setMappedLocations:560 → ~
[DEBUG] 18:43:33.579 path.go:setMappedLocations:565 → mapped_locations: map[]
[TRACE] 18:43:33.579 clean.go:Clean() - 0s
[TRACE] 18:43:33.579 path.go:normalize() - 0s
[TRACE] 18:43:33.579 clean.go:Clean() - 0s
[TRACE] 18:43:33.579 path.go:normalize() - 0s
[TRACE] 18:43:33.579 path.go:parsePath() - 0s
[TRACE] 18:43:33.579 path.go:parsePath() - 0s
[TRACE] 18:43:33.579 path.go:parsePath() - 0s
[DEBUG] 18:43:33.579 path.go:makeFolderFormatMap:833 → NO DATA
[DEBUG] 18:43:33.579 path.go:setStyle:213 → full
[DEBUG] 18:43:33.579 path.go:colorizePath:734 → cycle: []
[DEBUG] 18:43:33.579 path.go:getFolderSeparator:267 → NO DATA
[DEBUG] 18:43:33.579 path.go:getFolderSeparator:269 → \
[DEBUG] 18:43:33.579 path.go:colorizePath:737 → cycle_folder_separator: false
[DEBUG] 18:43:33.579 path.go:colorizePath:738 → %s
[DEBUG] 18:43:33.579 path.go:colorizePath:740 → %s
[DEBUG] 18:43:33.579 path.go:colorizePath:741 → %s
[DEBUG] 18:43:33.579 path.go:colorizePath:742 → %s
[TRACE] 18:43:33.579 path.go:Enabled() - 0s
[TRACE] 18:43:33.579 path.go:Enabled() - 0s
[TRACE] 18:43:33.579 path.go:Enabled() - 0s
[TRACE] 18:43:33.579 segment.go:string({{ if .WSL }}WSL at {{ end }}{{.Icon}}) - 1.0674ms
[TRACE] 18:43:33.579 segment.go:resolve(powerline) - 0s
[DEBUG] 18:43:33.579 terminal_windows.go:DirIsWritable:216 → current user is member of S-1-5-32-544
[DEBUG] 18:43:33.579 win32_windows.go:isWriteable:271 ↓
WRITE_DAC
WRITE_OWNER
SYNCHRONIZE
DELETE
READ_CONTROL
[DEBUG] 18:43:33.579 terminal_windows.go:DirIsWritable:216 → user has write access
[TRACE] 18:43:33.579 path.go:Enabled() - 523.3µs
[TRACE] 18:43:33.580 segment.go:string( {{ .Path }} ) - 514.1µs
[TRACE] 18:43:33.580 segment.go:resolve(plain) - 0s
[DEBUG] 18:43:33.580 value.go:call:581 → [main ≡ +0 ~2 -0 !]
[TRACE] 18:43:33.580 value.go:call(POSH_GIT_STRING) - 0s
[DEBUG] 18:43:33.580 value.go:call:581 → [main ≡ +0 ~2 -0 !]
[TRACE] 18:43:33.580 value.go:call(POSH_GIT_STRING) - 0s
[TRACE] 18:43:33.580 segment.go:string({{ if .Env.POSH_GIT_STRING }} {{ .Env.POSH_GIT_STRING }} {{ end }}) - 0s
[TRACE] 18:43:33.580 segment.go:resolve(plain) - 0s
[TRACE] 18:43:33.580 engine.go:applyPowerShellBleedPatch() - 0s
[TRACE] 18:43:33.580 segment.go:Execute() - 0s
[TRACE] 18:43:33.580 segment.go:Execute() - 0s
[TRACE] 18:43:33.580 segment.go:Execute() - 0s
[TRACE] 18:43:33.580 segment.go:Execute() - 0s
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.580 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[DEBUG] 18:43:33.580 segment.go:Execute:110 → segment: Root
[TRACE] 18:43:33.580 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.580 segment.go:Execute:112 → no toggles found
[DEBUG] 18:43:33.580 segment.go:Execute:110 → segment: Dart
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[DEBUG] 18:43:33.580 segment.go:Execute:112 → no toggles found
[TRACE] 18:43:33.580 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.580 segment.go:Execute:110 → segment: Node
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[DEBUG] 18:43:33.580 segment.go:Execute:112 → no toggles found
[TRACE] 18:43:33.580 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.580 segment.go:Execute:110 → segment: Time
[DEBUG] 18:43:33.580 segment.go:Execute:112 → no toggles found
[DEBUG] 18:43:33.580 time.go:Enabled:27 → 15:04:05
[TRACE] 18:43:33.580 segment.go:Execute() - 0s
[TRACE] 18:43:33.580 root.go:Enabled() - 0s
[DEBUG] 18:43:33.580 language.go:Enabled:118 → extensions: [*.js *.ts package.json .nvmrc pnpm-workspace.yaml .pnpmfile.cjs .vue]
[TRACE] 18:43:33.580 segment.go:Execute() - 0s
[DEBUG] 18:43:33.580 language.go:Enabled:119 → folders: []
[DEBUG] 18:43:33.580 language.go:Enabled:118 → extensions: [*.dart pubspec.yaml pubspec.yml pubspec.lock]
[DEBUG] 18:43:33.580 language.go:Enabled:126 → home_enabled: false
[TRACE] 18:43:33.580 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.580 language.go:Enabled:119 → folders: [.dart_tool]
[DEBUG] 18:43:33.580 segment.go:Execute:110 → segment: Python
[DEBUG] 18:43:33.580 language.go:Enabled:126 → home_enabled: false
[DEBUG] 18:43:33.580 segment.go:Execute:112 → no toggles found
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.580 segment.go:resolve(plain) - 0s
[DEBUG] 18:43:33.580 language.go:Enabled:138 → files
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[DEBUG] 18:43:33.580 language.go:Enabled:138 → files
[TRACE] 18:43:33.580 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.580 segment.go:Execute:110 → segment: Battery
[DEBUG] 18:43:33.580 python.go:Enabled:57 → context
[DEBUG] 18:43:33.580 segment.go:Execute:112 → no toggles found
[DEBUG] 18:43:33.580 node.go:loadContext:48 → fetch_package_manager: false
[DEBUG] 18:43:33.580 language.go:Enabled:118 → extensions: [*.py *.ipynb pyproject.toml venv.bak]
[DEBUG] 18:43:33.580 language.go:Enabled:119 → folders: [.venv venv virtualenv venv-win pyenv-win]
[DEBUG] 18:43:33.580 language.go:Enabled:126 → home_enabled: false
[TRACE] 18:43:33.580 battery.go:Enabled() - 0s
[DEBUG] 18:43:33.580 home.go:Home:26 → C:\Users\Danny
[DEBUG] 18:43:33.580 python.go:loadContext:65 → fetch_virtual_env: true
[DEBUG] 18:43:33.580 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.580 terminal.go:HasFiles(*.dart) - 0s
[DEBUG] 18:43:33.580 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.580 terminal.go:HasFiles(*.js) - 0s
[DEBUG] 18:43:33.580 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.580 terminal.go:HasFiles(pubspec.yaml) - 0s
[DEBUG] 18:43:33.580 terminal.go:HasFiles:114 → true
[DEBUG] 18:43:33.580 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.580 terminal.go:HasFiles(*.ts) - 0s
[TRACE] 18:43:33.580 terminal.go:HasFiles(pubspec.yml) - 0s
[DEBUG] 18:43:33.580 language.go:Enabled:157 → fetch_version: true
[DEBUG] 18:43:33.580 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.580 terminal.go:HasFiles(pubspec.lock) - 0s
[DEBUG] 18:43:33.580 language.go:hasLanguageFolders:199 → false
[TRACE] 18:43:33.580 language.go:hasLanguageFolders(.dart_tool) - 0s
[TRACE] 18:43:33.580 segment.go:resolve(powerline) - 0s
[ERROR] 18:43:33.581 battery.go:Enabled:38 → no battery
[TRACE] 18:43:33.581 battery.go:Enabled() - 1.6369ms
[DEBUG] 18:43:33.584 terminal.go:HasCommand:323 → C:\Program Files\nodejs\node.exe
[TRACE] 18:43:33.584 terminal.go:HasCommand(node) - 4.7007ms
[TRACE] 18:43:33.584 language.go:runCommand(node) - 4.7007ms
[DEBUG] 18:43:33.584 python.go:pyvenvCfgPrompt:179 → C:\Users\Danny\AppData\Local\Microsoft\WindowsApps\python.exe
[TRACE] 18:43:33.584 python.go:pyvenvCfgPrompt(python) - 4.7007ms
[DEBUG] 18:43:33.584 python.go:pyvenvCfgPrompt:189 → false
[TRACE] 18:43:33.584 python.go:pyvenvCfgPrompt(pyvenv.cfg) - 0s
[DEBUG] 18:43:33.585 python.go:pyvenvCfgPrompt:193 → false
[TRACE] 18:43:33.585 python.go:pyvenvCfgPrompt(pyvenv.cfg) - 512.2µs
[DEBUG] 18:43:33.585 python.go:loadContext:79 → folder_name_fallback: true
[DEBUG] 18:43:33.585 python.go:loadContext:80 → default_venv_names: [.venv venv]
[DEBUG] 18:43:33.585 python.go:loadContext:87 → NO DATA
[TRACE] 18:43:33.585 python.go:loadContext(VIRTUAL_ENV) - 0s
[DEBUG] 18:43:33.585 python.go:loadContext:87 → NO DATA
[TRACE] 18:43:33.585 python.go:loadContext(CONDA_ENV_PATH) - 0s
[DEBUG] 18:43:33.585 python.go:loadContext:87 → NO DATA
[TRACE] 18:43:33.585 python.go:loadContext(CONDA_DEFAULT_ENV) - 0s
[DEBUG] 18:43:33.585 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.585 terminal.go:HasFiles(*.py) - 0s
[DEBUG] 18:43:33.585 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.585 terminal.go:HasFiles(*.ipynb) - 0s
[DEBUG] 18:43:33.585 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.585 terminal.go:HasFiles(pyproject.toml) - 0s
[DEBUG] 18:43:33.585 terminal.go:HasFiles:114 → false
[TRACE] 18:43:33.585 terminal.go:HasFiles(venv.bak) - 0s
[DEBUG] 18:43:33.585 language.go:hasLanguageFolders:199 → false
[TRACE] 18:43:33.585 language.go:hasLanguageFolders(.venv) - 0s
[DEBUG] 18:43:33.585 language.go:hasLanguageFolders:199 → false
[TRACE] 18:43:33.585 language.go:hasLanguageFolders(venv) - 0s
[DEBUG] 18:43:33.585 language.go:hasLanguageFolders:199 → false
[TRACE] 18:43:33.585 language.go:hasLanguageFolders(virtualenv) - 0s
[DEBUG] 18:43:33.585 language.go:hasLanguageFolders:199 → false
[TRACE] 18:43:33.585 language.go:hasLanguageFolders(venv-win) - 0s
[DEBUG] 18:43:33.585 language.go:hasLanguageFolders:199 → false
[TRACE] 18:43:33.585 language.go:hasLanguageFolders(pyenv-win) - 0s
[DEBUG] 18:43:33.618 language.go:runCommand:264 → v22.11.0
[TRACE] 18:43:33.618 language.go:runCommand(node --version) - 33.4445ms
[DEBUG] 18:43:33.618 language.go:buildVersionURL:296 → https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V{{ .Major }}.md#{{ .Full }}
[TRACE] 18:43:33.618 language.go:buildVersionURL(https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V{{ .Major }}.md#{{ .Full }}) - 524.7µs
[DEBUG] 18:43:33.618 language.go:setVersion:244 → none
[ERROR] 18:43:33.618 node.go:matchesVersionFile:65 → open C:\HigherLMS\lms.ui\.nvmrc: The system cannot find the file specified.
[TRACE] 18:43:33.618 node.go:matchesVersionFile(.nvmrc) - 0s
[TRACE] 18:43:33.618 segment.go:string(| {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ) - 0s
[TRACE] 18:43:33.618 segment.go:resolve(powerline) - 0s
[TRACE] 18:43:33.618 segment.go:resolve(plain) - 0s
[TRACE] 18:43:33.618 segment.go:resolve(powerline) - 0s
[TRACE] 18:43:33.618 segment.go:string(| {{ .CurrentDate | date .Format }} ) - 0s
[TRACE] 18:43:33.618 segment.go:resolve(plain) - 0s
[DEBUG] 18:43:33.618 terminal_windows.go:TerminalWidth:99 → terminal width: 98
[TRACE] 18:43:33.618 engine.go:canWriteRightBlock() - 0s
[TRACE] 18:43:33.618 engine.go:applyPowerShellBleedPatch() - 0s
[TRACE] 18:43:33.618 segment.go:Execute() - 0s
[DEBUG] 18:43:33.619 home.go:Home:26 → C:\Users\Danny
[TRACE] 18:43:33.619 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 18:43:33.619 segment.go:Execute:110 → segment: Status
[DEBUG] 18:43:33.619 segment.go:Execute:112 → no toggles found
[TRACE] 18:43:33.619 status.go:Enabled() - 0s
[DEBUG] 18:43:33.619 status.go:formatStatus:45 → {{ .Code }}
[TRACE] 18:43:33.619 status.go:formatStatus({{ .Code }}) - 0s
[DEBUG] 18:43:33.619 status.go:Enabled:37 → always_enabled: true
[TRACE] 18:43:33.619 segment.go:string(➜ ) - 0s
[TRACE] 18:43:33.619 list.go:FirstMatch({{ if gt .Code 0 }}red{{ end }}) - 0s
[TRACE] 18:43:33.619 segment.go:resolve(powerline) - 0s
[TRACE] 18:43:33.619 list.go:FirstMatch({{ if gt .Code 0 }}red{{ end }}) - 0s
[TRACE] 18:43:33.619 engine.go:applyPowerShellBleedPatch() - 0s
[TRACE] 18:43:33.619 primary.go:Primary() - 0s
[TRACE] 18:43:33.619 debug.go:PrintDebug() - 0s
[TRACE] 18:43:33.619 debug.go:PrintDebug() - 0s
Code of Conduct
What happened?
When using the documented method of including a posh-git prompt in oh-my-posh (https://ohmyposh.dev/docs/segments/scm/git#posh-git) in a left-aligned segment, causes the subsequent right-aligned segment to wrap to the next line. This is presumably because the number of spaces left available for the console width is overestimated.
Note that using any other environment variable in the text template does not cause this issue, only the dynamic POSH_GIT_STRING environment variable is exhibiting the problem.
Based on information found in the linked documentation, add the following to profile:
An example of the result:
Theme
Customized based off of
negligible, replace the git segment with:{ "template":"{{ if .Env.POSH_GIT_STRING }} {{ .Env.POSH_GIT_STRING }} {{ end }}", "type": "text", "style": "plain" }What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output