JanDeDobbeleer / oh-my-posh

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

fish exit code segment not working #1013

Closed floh96 closed 2 years ago

floh96 commented 2 years ago

Code of Conduct

What happened?

exit code is not displayed Unbenannt

Version

5.6.4

Theme

{
  "osc99": true,
  "terminal_background": "{{ if eq \"vscode\" .Env.TERM_PROGRAM }}#1E1E1E{{end}}",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "exit",
          "style": "diamond",
          "foreground": "#ffffff",
          "background": "#007ACC",
          "trailing_diamond": "",
          "properties": {
            "prefix": "<transparent></>  ",
            "postfix": " "
          }
        },
        {
          "type": "root",
          "style": "diamond",
          "foreground": "#e83d23",
          "background": "#007ACC",
          "trailing_diamond": "",
          "properties": {
            "prefix": "<transparent></> ",
            "postfix": " ",
            "root_icon": "ﮊ"
          }
        },
        {
          "type": "session",
          "style": "diamond",
          "foreground": "#ffffff",
          "background": "#007ACC",
          "trailing_diamond": "",
          "properties": {
            "user_info_separator": "@",
            "display_host": false,
            "prefix": "<transparent></> ",
            "postfix": " "
          }
        },
        {
          "type": "path",
          "style": "plain",
          "foreground": "#ffffff",
          "background": "#007ACC",
          "properties" : {
              "home_icon": "~",
              "folder_icon": "",
              "windows_registry_icon": "",
              "style": "full",
              "prefix": "<transparent></> ",
              "postfix": " "
          }
        },
        {
          "type": "git",
          "style": "plain",
          "foreground": "#ffffff",
          "background": "#007ACC",
          "properties": {
            "display_status": true,
            "branch_icon": "",
            "branch_identical_icon": "≡",
            "branch_ahead_icon": "↑",
            "branch_behind_icon": "↓",
            "branch_gone_icon": "≢",
            "local_working_icon": "",
            "local_staged_icon": "",
            "prefix": "<#ffffff></> ",
            "postfix": " "
          }
        },
        {
          "type": "text",
          "style": "plain",
          "foreground": "#007ACC",
          "properties": {
            "prefix": "",
            "text": ""
          }
        }
      ]
    }
  ]
}

What OS are you seeing the problem on?

wsl ubuntu 18.04

Which shell are you using?

fish

Relevant log output

No response

JanDeDobbeleer commented 2 years ago

I don't know if we have this fully supported on fish. That's a long time ago so I'll need to check.

floh96 commented 2 years ago

fyi i updated my fish config according to the docs new config: oh-my-posh --init --shell fish --config $HOME/.oh-my-posh/themes/fish.json | source exit status is not working. old config:

function fish_prompt
  eval oh-my-posh -config $HOME/.oh-my-posh/themes/fish.json -error $status
end

exit status is working

JanDeDobbeleer commented 2 years ago

@floh96 yes, the issue is that we do not cache the value and thus override it. I'll create a fix tomorrow 🤦🏻‍♂️

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