Oh-my-posh3: Background colors on segments not rendering in MacOS during manual execution

Created on 12 Oct 2020  ·  8Comments  ·  Source: JanDeDobbeleer/oh-my-posh3

Prerequisites

  • [x] I have read and understand the CONTRIBUTING guide
  • [x] I looked for duplicate issues before submitting this one

Description

Using the example theme from the documentation and running oh-my-posh manually, I don't see background colors rendered.

I'm not sure if this is an artifact of trying to execute it manually or if this means there's something else I need to set. I was trying to do some testing to verify JanDeDobbeleer/oh-my-posh#177 and try converting my custom v2 theme to v3, but I'm not willing to mess up my existing prompt environment if I can't tell if this is going to work the same.

Environment

  • Oh my Posh version: 3.14.2
  • Theme: Example from docs.
  • Operating System: MacOS
  • Shell: PowerShell Core
  • Terminal: Mac Terminal

Steps to Reproduce

First, create example.json with the theme from the docs. Note it has a foreground and background color.

Theme:

{
  "final_space": true,
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "",
          "foreground": "#ffffff",
          "background": "#61AFEF",
          "properties": {
            "prefix": "  ",
            "style": "folder"
          }
        }
      ]
    }
  ]
}

Next, run the oh-my-posh executable and pass it the example.json as the configuration, like:

posh-darwin-amd64 -config ./example.json

Expected behavior: I expected to see the current folder shown with a white foreground and a light blue background.

Actual behavior:

Manual run of oh-my-posh 3

Note there's no light blue background and the foreground color is not white.

question

All 8 comments

My first bet is that the default terminal doesn't accept the colors. Because apart from that it renders what it should. Do me a favor and check iterm2, I'll check how to enable a full color profile in the default terminal later today.

Yup, iTerm does seem to render correctly. I mean, I don't have the font set up right, but the colors are correct.

Screen Shot 2020-10-12 at 9 06 33 AM

According to the interwebs in regards to Terminal:

Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color

I already have that set.

Advanced Preferences

I also have text set as "display ANSI colors"... however, now I'm wondering if there's some limitation around which colors are allowed or something based on the fact there are only 16 colors shown here.

Text Preferences

The colors displaying in my existing PowerShell Core prompt (shown in the initial issue) are part of the ANSI palette shown in this preference box.

I did consider that it might have been some PowerShell Core issue, so I started a fresh bash shell without PowerShell Core in the mix and got the same results as when PowerShell Core was there - folder shown in gray text, no background.

It's not related to PowerShell but the terminal. I'll try to check which setting is causing this but it's definitely a Terminal issue and not related to oh-my-posh.

The way I see this, it just can't ever work in Terminal. Everything I tried to set doesn't work so I'll add that context to the docs.

Fair enough. I definitely appreciate your looking into it!

I I ever find a solution I'll make sure to provide it though.

Was this page helpful?
0 / 5 - 0 ratings