JanDeDobbeleer / oh-my-posh

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

leading powerline is black on non-black terminal in vscode #1491

Closed erresen closed 2 years ago

erresen commented 2 years ago

Code of Conduct

What happened?

In VS Code, if the terminal window doesn't have a black background, the leading powerline symbol for my git segment shows up as black: image

This seems to be isolated to using powershell within VS Code.

This isn't an issue in windows terminal or in VS Code on a mac using the same theme.

Windows terminal: image

VS Code Mac zsh: image

I would expect theme to be consistent across terminals (i.e. the symbol to be transparent).

Theme

I was using my own custom theme: https://github.com/erresen/oh-my-posh-aggy-theme/blob/main/aggy.omp.json

{
    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
    "blocks": [
        {
            "type": "prompt",
            "alignment": "left",
            "segments": [
                {
                    "type": "path",
                    "style": "diamond",
                    "trailing_diamond": "\uE0B0",
                    "foreground": "#d0d0d0",
                    "background": "#292d3e",
                    "properties": {
                        "style": "full"
                    }
                },
                {
                    "type": "git",
                    "style": "powerline",
                    "powerline_symbol": "\uE0B0",
                    "foreground": "#ffcb6b",
                    "background": "#292d3e",
                    "properties": {
                        "fetch_status": true,
                        "fetch_upstream_icon": true,
                        "template": "{{ .HEAD }}{{ if .Staging.Changed }}<#c3e88d> ● {{ .Staging.String }}</>{{ end }}{{ if .Working.Changed }}<#f07178> ● {{ .Working.String }}</>{{ end }}"
                    }
                }
            ]
        },
        {
            "type": "prompt",
            "alignment": "right",
            "segments": [
                {
                    "type": "time",
                    "style": "diamond",
                    "foreground": "#d0d0d0",
                    "background": "#292d3e",
                    "leading_diamond": "\ue0b2",
                    "properties": {
                        "time_format": "2006-01-02 15:04:05"
                    }
                }
            ]
        },
        {
            "type": "prompt",
            "alignment": "left",
            "newline": true,
            "segments": [
                {
                    "type": "shell",
                    "style": "diamond",
                    "foreground": "#d0d0d0",
                    "background": "#292d3e",
                    "trailing_diamond": "\ue0b0",
                    "properties": {
                        "mapped_shell_names": {
                            "powershell": "pwsh"
                        }
                    }
                },
                {
                    "type": "root",
                    "style": "powerline",
                    "powerline_symbol": "\uE0B0",
                    "foreground": "#292d3e",
                    "background": "#ffcb6b"
                }
            ]
        }
    ],
    "final_space": true
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 6.29.1

Segments:

ConsoleTitle(false) -   0 ms -
path(true)   -   0 ms -  E:\Git\oh-my-posh-aggy-theme 
git(true)    - 102 ms -  main 
time(true)   -   0 ms -  2021-12-23 13:01:09 
shell(true)  -   0 ms -  pwsh 
root(false)  -   0 ms -

Run duration: 103.6608ms

Logs:

2021/12/23 13:01:09 debug: getenv
C:\Users\james_t\AppData\Local
2021/12/23 13:01:09 getenv duration: 0s, args: LOCALAPPDATA
2021/12/23 13:01:09 getCachePath duration: 531.2µs, args:
2021/12/23 13:01:09 getArgs duration: 0s, args:
2021/12/23 13:01:09 getArgs duration: 0s, args:
2021/12/23 13:01:09 getShellName duration: 13.0716ms, args:
2021/12/23 13:01:09 debug: getenv

2021/12/23 13:01:09 getenv duration: 0s, args: OMP_CACHE_DISABLED
2021/12/23 13:01:09 isRunningAsRoot duration: 20.9µs, args:
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getShellName duration: 0s, args:
2021/12/23 13:01:09 getCurrentUser duration: 0s, args:
2021/12/23 13:01:09 getHostName duration: 0s, args:
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 getArgs duration: 0s, args:
2021/12/23 13:01:09 getRuntimeGOOS duration: 0s, args:
2021/12/23 13:01:09 getRuntimeGOOS duration: 0s, args:
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 getRuntimeGOOS duration: 0s, args:
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 getRuntimeGOOS duration: 0s, args:
2021/12/23 13:01:09 hasCommand duration: 60.036ms, args: git.exe
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 hasParentFilePath duration: 0s, args: .git
2021/12/23 13:01:09 debug: runCommand
# branch.oid 72920832889580337aa2d2b6f15787e40922e8a1
# branch.head main
# branch.upstream origin/main
# branch.ab +0 -0
2021/12/23 13:01:09 runCommand duration: 41.487ms, args: git.exe -C  --no-optional-locks -c core.quotepath=false -c color.status=false status -unormal --branch --porcelain=2
2021/12/23 13:01:09 hasFolder duration: 0s, args: E:\Git\oh-my-posh-aggy-theme\.git/rebase-merge
2021/12/23 13:01:09 hasFolder duration: 0s, args: E:\Git\oh-my-posh-aggy-theme\.git/rebase-apply
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 hasFilesInDir duration: 0s, args: MERGE_MSG
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 hasFilesInDir duration: 0s, args: CHERRY_PICK_HEAD
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 hasFilesInDir duration: 14.1µs, args: REVERT_HEAD
2021/12/23 13:01:09 getPathSeperator duration: 0s, args:
2021/12/23 13:01:09 hasFilesInDir duration: 0s, args: sequencer/todo
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 getShellName duration: 0s, args:
2021/12/23 13:01:09 getcwd duration: 0s, args:
2021/12/23 13:01:09 isRunningAsRoot duration: 0s, args:
JanDeDobbeleer commented 2 years ago

@erresen that's a bug in VSCode which is fixed in Windows 11. See here.

github-actions[bot] commented 6 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.