JanDeDobbeleer / oh-my-posh

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

[Feature request] Set background & foreground inline #179

Closed fedeiglesias closed 3 years ago

fedeiglesias commented 3 years ago

Prerequisites

Description

This is not an issue, its a "nice to have" feature. As we read in the color documentation we can set a foreground color in the segment for any specific text. It will be nice to be able to set also the background, i think something like this

<#ff0000,#00ff00>Hello budy!</>

Where the first or the second can be the foreground and background.

It will be usefull in escenarios like that, in where we want to put a "label" for an specific path (but not for the rest)

image

Thank you for this awesome tool !!!

JanDeDobbeleer commented 3 years ago

Let's see what can be done. I think it's possible, and the suggestion could even work in terms of interface.

shedric1 commented 3 years ago

I was looking for a way to do this, and the syntax suggestion inspired me to get it set up. Hope that's all right! I'm no expert with Go, so feel free to suggest changes/totally alter it as needed.

Existing themes with in-line colors shouldn't need to change anything, the suggested syntax only adds new options.

And now I can connect plain style segments to powerline segments without a blank space between! image of inline background color changes

JanDeDobbeleer commented 3 years ago

Should be live! (or ASAP 😅)

fedeiglesias commented 3 years ago

@shedric1 thank you very much mate! I think i need to learn some GoLang 😄 @JanDeDobbeleer I'm in love with oh-my-posh!!! in my new job we use Win env for work and I won't miss bash at all! Here is the feature working like a charm 👌

ohmyposh

github-actions[bot] commented 4 months ago

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.