Replies: 5 comments 23 replies
-
If I'm understanding you correctly, you can get the behavior you want by splitting your prompt into three blocks and using powerline style within each block. e.g.
Using "diamond" to emulate "powerline" is problematic because if the leading segment isn't displayed the next segment which is rendered won't render with the ">" (or whatever character) you want that range of segments to begin with. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Awesome! Thank you so much 🙂 |
Beta Was this translation helpful? Give feedback.
-
I'm happy to see |
Beta Was this translation helpful? Give feedback.
-
Thinking some more about this problem, while it's now possible to get the sort of effect I was after, I still find it tricky to reason about what's going on, because the "powerline" segment type doesn't really define a start or end character, but rather a separator between two segments. It's probably way too late now to change things, but the way I think about it, segments should just have a "diamond" type ("plain" is simply a diamond with no end characters) and the "powerline" block should be something else - a "section" that contains multiple segments which are separated by the powerline charcater. So something like:
Segments in a "powerline_section" should probably be required to be type "plain", because diamond doesn't make sense if you're separating the segments with a powerline symbol. It's a little more manual to get the effect you want with this approach, but there's a lot less context-dependent behaviour, so overall it's (in my view) a lot more understandable. And it works better when you want more complex displays, like |
Beta Was this translation helpful? Give feedback.
-
I'm trying to construct a prompt that has various "sections". Each section ends with a powerline ">" symbol, then a gap, then the next section. That's relatively easy, you can do it fine with something like this:
(the "leading diamond" is an inverted Powerline diamond, to avoid problems with transparent forground not rendering properly on Windows Terminal). The problem is that if A doesn't display, B merges into Part 1. I tried adding a zero-width text column between part 1 and A/B/C, but then the spacing goes wrong.
The reason I want this sort of layout is that I want to split my prompt into sections: system data, directory, VCS, language versions, times. Within each section there may be zero, one or many sections (a directory could have no code, all Python, or a mix of Python and Javascript, for example).
Is this possible? If it isn't, I can simply design a different layout, but I was hoping to do something like this because it's a bit more readable than an unbroken prompt and better structured than having every segment separated from the others.
Beta Was this translation helpful? Give feedback.
All reactions