Closed NoF0rte closed 1 year ago
@NoF0rte can you create a PR for that small revert? Would be super amazing 🙏🏻
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
There seems to be some weird unexpected behavior when using multiple segments of the same type. With the provided config, this is what the prompt should look like
Using
oh-my-posh
compiled from the latest commit (a3ef56f7fad99b001f3d0ced7b1e5b3a60131915), the prompt can look like the following screenshotsPlaying around with the code myself, I found the issue comes from commit 04bfb2eef16818424881a3426de87f24f8ac79d5. It seems like since there are now global instances of each segment type's
SegmentWriter
, using multiple of the same segment type can result in unexpected behavior. Reverting themapSegmentWithWriter
function insrc/engine/segment.go
so that it creates theSegmentWriter
map every time it is called, fixes the issue.Theme
What OS are you seeing the problem on?
Linux
Which shell are you using?
zsh
Log output