JanDeDobbeleer / oh-my-posh

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

prompt Python bug? #3126

Closed jgarza9788 closed 1 year ago

jgarza9788 commented 1 year ago

Code of Conduct

What happened?

note: i have seen that other bugs like this have some in, they provided a clue... but still not working

A bug happened! oh-my-posh version: 12.18.3 windows terminal, powershell, on windows 10

the Python part of the prompt is still rendering even though i do not have py files in this folder. and display_mode is false.

Screenshot 2022-11-25 131850

Theme

my theme is custom


{
    // "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",

    "blocks":[
        {
            "alignment": "left",
            "newline": true,
            "segments": [
                {
                        "background": "#006EFF",
                        "background_templates": [
                            "{{ if gt .Code 0 }}#ff0015{{ end }}"
                        ],
                        "foreground": "#ffffff",
                        // "leading_diamond": "\ue0c5",
                        "leading_diamond": "\ue0ba",
                        "properties": {
                            "always_enabled": true
                        },
                        "style": "diamond",
                        // "template": " {{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }} ",
                        // "template": " {{ if gt .Code 0 }}\uf00d 🤬{{ else }}\uf42e 🤩{{ end }} ",
                        "template": " {{ if gt .Code 0 }} \uf00d \uf00d \uf00d {{ else }} \uf42e \uf42e \uf42e {{ end }} ",
                        // "trailing_diamond": "\ue0c4 \n",
                        "trailing_diamond": "\ue0bc \n",
                        "type": "exit"

                }
                ],
            "type": "prompt"
        },
        {
            "alignment": "left",
            "newline": true,
            "segments": [
                {
                "background": "#0C0C0C",
                "foreground": "#66d9ef",
                "leading_diamond": "\ue0c5",
                "properties": {
                    "macos": "mac",
                    "windows": "\uf17a"
                },
                "style": "diamond",
                "template": "  {{ if .WSL }}WSL at {{ end }}{{.Icon}}  ",
                "trailing_diamond": "",
                "type": "os"
                },
                // {
                //     "type": "text",
                //     "style": "diamond",
                //     "leading_diamond": "",
                //     "foreground": "#0C0C0C",
                //     "background": "#F4005F",
                //     // "template": "\ue0c8" //rip
                //     "template": "\ue0c6" //digital
                // },
                // {
                // "type": "session",
                // "style": "powerline",
                // // "powerline_symbol": "\ue0c6",  //digital
                // "powerline_symbol": "\ue0c8", //rip
                // "invert_powerline": false,
                // "foreground": "#0C0C0C",
                // "background": "#F4005F",
                // "template": " {{ .UserName }} "
                // },
                {
                "type": "path",
                "style": "powerline",
                "powerline_symbol": "\ue0c4",  //digital
                // "powerline_symbol": "\ue0c8", //rip
                "foreground": "#0C0C0C",
                "background": "#98E024",

                // "foreground": "#98E024",
                // "background": "#0C0C0C",
                "properties": {
                    // "style": "folder",
                    "folder_icon": "\ue5ff",
                    // "folder_separator_icon": " \ue0b1 ",
                    "folder_separator_icon": " \uf44a ",
                    // "folder_separator_icon": " \ue0c7\ue0c6 ",
                    "home_icon": "\uf7db",
                    "style": "agnoster"
                    }
                }

            ],
            "type":"prompt"
        }
        ,
        {
            "alignment": "right",
            "newline": false,
            "segments": [
                {
                "background": "#fd971f",
                "foreground": "#0C0C0C",
                "properties": {
                    "branch_icon": ""
                },
                "leading_diamond": "\ue0b6",
                "trailing_diamond": "\ue0b4 ",
                "style": "diamond",
                // "template": " \uF408 git({{ .HEAD }}) ",
                "template": "\ue702 {{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ",
                "type": "git"
                }

                ,{
                "type": "python",
                "style": "diamond",
                "leading_diamond": "\ue0b6",
                "trailing_diamond": "\ue0b4 ",
                "foreground": "#0C0C0C",
                "background": "#66d9ef",
                "home_enabled": false,
                "display_default": false,
                "display_mode": "files",
                "template": "\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Major }}.{{ .Minor }}{{ end }} "
                }

        ],
        "type":"prompt"
    },
        {
            "alignment": "left",
            "newline": false,
            "segments": [
                {
                "type": "text",
                "style": "plain",
                "template": "\n"
                }
            ],
            "type": "prompt"
        }
    ],

    "final_space": true,
    "version": 2

}

What OS are you seeing the problem on?

No response

Which shell are you using?

No response

Log output

Version: 12.18.3

Segments:

ConsoleTitle(false) -   0 ms - 
exit(true)    -   1 ms -        

os(true)      -   1 ms -     
path(true)    -   1 ms -    .config 
git(true)     -  28 ms -  main  
python(true)  -  22 ms -  base 3.9  
text(true)    -   0 ms - 


Run duration: 70.1006ms

Cache path: C:\Users\JGarza\AppData\Local\oh-my-posh

Config path: C:\Users\JGarza\.config\powershell\custom.omp.json

Logs:

2022/11/25 13:24:46 Getenv
C:\Users\JGarza\AppData\Local
2022/11/25 13:24:46 Getenv: 0s, args: LOCALAPPDATA
2022/11/25 13:24:46 CachePath: 543.6┬╡s
2022/11/25 13:24:46 Getenv
C:\Users\JGarza\.config\powershell\custom.omp.json
2022/11/25 13:24:46 Getenv: 0s, args: POSH_THEME
2022/11/25 13:24:46 Shell
process name: pwsh.exe
2022/11/25 13:24:46 Shell: 12.7048ms
2022/11/25 13:24:46 resolveConfigPath: 12.7048ms
2022/11/25 13:24:46 Init: 14.8774ms
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 config.loadConfig: 1.1625ms
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 Getenv

2022/11/25 13:24:46 Getenv: 0s, args: OMP_CACHE_DISABLED
2022/11/25 13:24:46 WindowsRegistryKeyValue: 0s, args: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 WindowsRegistryKeyValue
ColorizationColor(DWORD): 0xC40078D7
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 ErrorCode: 0s
2022/11/25 13:24:46 Root: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 ErrorCode: 0s
2022/11/25 13:24:46 IsWsl: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 User
jgarza
2022/11/25 13:24:46 User: 0s
2022/11/25 13:24:46 Host
TheBlackPearl
2022/11/25 13:24:46 Host: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 PathSeparator: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 IsWsl: 0s
2022/11/25 13:24:46 StackCount: 0s
2022/11/25 13:24:46 isWriteable
not current user or in group
2022/11/25 13:24:46 isWriteable
current user is member of S-1-5-32-544
2022/11/25 13:24:46 isWriteable
WRITE_DAC
WRITE_OWNER
SYNCHRONIZE
DELETE
READ_CONTROL
2022/11/25 13:24:46 isWriteable
user has write access
2022/11/25 13:24:46 DirIsWritable: 541.8┬╡s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 CommandPath
C:\Program Files\Git\cmd\git.exe
2022/11/25 13:24:46 CommandPath: 27.8311ms, args: git.exe
2022/11/25 13:24:46 HasCommand: 27.8311ms, args: git.exe
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 22.6┬╡s
2022/11/25 13:24:46 HasParentFilePath: 22.6┬╡s, args: .git
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 Getenv

2022/11/25 13:24:46 Getenv: 0s, args: POSH_GIT_STATUS
2022/11/25 13:24:46 FileContent
ref: refs/heads/main

2022/11/25 13:24:46 FileContent: 0s, args: C:\Users\JGarza\.config\.git/HEAD
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 Getenv

2022/11/25 13:24:46 Getenv: 0s, args: VIRTUAL_ENV
2022/11/25 13:24:46 Getenv

2022/11/25 13:24:46 Getenv: 0s, args: CONDA_ENV_PATH
2022/11/25 13:24:46 Getenv
base
2022/11/25 13:24:46 Getenv: 0s, args: CONDA_DEFAULT_ENV
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 CommandPath
C:\Users\JGarza\miniconda3\python.exe
2022/11/25 13:24:46 CommandPath: 586.6┬╡s, args: python
2022/11/25 13:24:46 Getenv

2022/11/25 13:24:46 Getenv: 0s, args: PYENV_ROOT
2022/11/25 13:24:46 CommandPath
C:\Users\JGarza\miniconda3\python.exe
2022/11/25 13:24:46 CommandPath: 0s, args: python
2022/11/25 13:24:46 HasCommand: 0s, args: python
2022/11/25 13:24:46 RunCommand
Python 3.9.12
2022/11/25 13:24:46 RunCommand: 21.2378ms, args: python --version
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 Flags: 0s
2022/11/25 13:24:46 Pwd
C:\Users\JGarza\.config
2022/11/25 13:24:46 Pwd: 0s
2022/11/25 13:24:46 Home
C:\Users\JGarza
2022/11/25 13:24:46 GOOS: 0s
2022/11/25 13:24:46 TemplateCache: 0s
2022/11/25 13:24:46 Shell: 0s
2022/11/25 13:24:46 Getenv
C:\Users\JGarza\AppData\Local
2022/11/25 13:24:46 Getenv: 0s, args: LOCALAPPDATA
2022/11/25 13:24:46 CachePath: 593.1┬╡s
2022/11/25 13:24:46 Flags: 0s
JanDeDobbeleer commented 1 year ago

@jgarza9788 the properties need to be inside the properties blocks:

{
    "type": "python",
    "style": "diamond",
    "leading_diamond": "\ue0b6",
    "trailing_diamond": "\ue0b4 ",
    "foreground": "#0C0C0C",
    "background": "#66d9ef",
    "properties": {
        "home_enabled": false,
        "display_default": false,
        "display_mode": "files"
    },
    "template": "\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Major }}.{{ .Minor }}{{ end }} "
}
jgarza9788 commented 1 year ago

that makes so much sense now. thanks, and happy thanksgiving (and the rest of the holidays also)

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