JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.51k stars 2.4k forks source link

fix(template): store segment data synchronous #5863

Closed JanDeDobbeleer closed 2 weeks ago

JanDeDobbeleer commented 2 weeks ago

Prerequisites

JanDeDobbeleer commented 2 weeks ago

@lewis-yeung this should solve the issue in #5859 but the only line that really matters is the change in segment.go. The map rewrite is only to make it more simple. In the end it turns out the logic is correct but it writes so fast that the map breaks in parallel. Adding it again after write makes it behave correctly in all cases apparently.

Can you do a sanity check here?

lewis-yeung commented 2 weeks ago

@JanDeDobbeleer Seems fixed.