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

posh-git pushing blocks that are position right to the left #1744

Closed A-Lamia closed 2 years ago

A-Lamia commented 2 years ago

Code of Conduct

What happened?

I update to the latest version updated my theme i started having this issue.

image

it's supposed to be aligned to the right side.

image

without posh-git

Theme

I'm using a modified bubbles.omp with posh-git.

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "right",
      "segments": [
        {
          "background": "#3b4252",
          "foreground": "#a3be8c",
          "leading_diamond": "\ue0b6",
          "properties": {
            "style": "folder",
            "template": "\ue5ff {{ .Path }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "path"
        },
        {
          "background": "#3b4252",
          "foreground": "#88c0d0",
          "leading_diamond": " \ue0b6",
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "poshgit"
        },
        {
          "background": "#3b4252",
          "foreground": "#88c0d0",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_icon": "",
            "var_name": "POSH"
          },
          "style": "powerline",
          "type": "envvar"
        },
        {
          "background": "#3b4252",
          "foreground": "#E4F34A",
          "leading_diamond": " \ue0b6",
          "properties": {
            "fetch_version": false,
            "template": "\ue235{{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "python"
        },
        {
          "background": "#3b4252",
          "foreground": "#7FD5EA",
          "leading_diamond": " \ue0b6",
          "properties": {
            "fetch_version": false,
            "template": "\ufcd1{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "go"
        },
        {
          "background": "#3b4252",
          "foreground": "#42E66C",
          "leading_diamond": " \ue0b6",
          "properties": {
            "fetch_version": false,
            "template": "\ue718{{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "node"
        },
        {
          "background": "#3b4252",
          "foreground": "#E64747",
          "leading_diamond": " \ue0b6",
          "properties": {
            "fetch_version": false,
            "template": "\ue791{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "ruby"
        },
        {
          "background": "#3b4252",
          "foreground": "#E64747",
          "leading_diamond": " \ue0b6",
          "properties": {
            "fetch_version": false,
            "template": "\ue738{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "java"
        },
        {
          "background": "#3b4252",
          "foreground": "#9B6BDF",
          "leading_diamond": " \ue0b6",
          "properties": {
            "fetch_version": false,
            "template": "\ue624{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "julia"
        },
        {
          "background": "#3b4252",
          "foreground": "#4063D8",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "template": " \ue73d {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
          },
          "style": "powerline",
          "type": "php"
        },
        {
          "background": "#3b4252",
          "foreground": "#F74C00",
          "leading_diamond": " \ue0b6",
          "properties": {
            "template": " \ue7a8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "rust"
        },
        {
          "background": "#3b4252",
          "foreground": "#9B6BDF",
          "foreground_templates": [
            "{{ if eq \"Full\" .State.String }}#4caf50{{ end }}",
            "{{ if eq \"Charging\" .State.String }}#40c4ff{{ end }}",
            "{{ if eq \"Discharging\" .State.String }}#ff5722{{ end }}"
          ],
          "leading_diamond": " \ue0b6",
          "properties": {
            "charged_icon": "• ",
            "charging_icon": "\u21e1 ",
            "discharging_icon": "\u21e3 ",
            "template": "{{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "battery"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "background": "#3b4252",
          "foreground": "#b48ead",
          "leading_diamond": "\ue0b6",
          "properties": {
            "style": "austin",
            "template": "{{ .FormattedMs }}",
            "threshold": 150
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4 ",
          "type": "executiontime"
        },
        {
          "background": "#3b4252",
          "foreground": "#88c0d0",
          "leading_diamond": "\ue0b6",
          "properties": {
            "template": "\u276f"
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b4",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "final_space": true,
  "version": 1
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 7.16.2

Segments:

ConsoleTitle(false) -   0 ms -
session(true)  -   0 ms -  lamia@lamia 
path(true)     -   0 ms -  game
shell(true)    -   0 ms -  uni
text(true)     -   0 ms -  no config
exit(true)     -   1 ms -  

Run duration: 3.7966ms

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

Logs:

2022/02/12 06:06:51 Args duration: 0s, args:
2022/02/12 06:06:51 Args duration: 0s, args:
2022/02/12 06:06:51 Args duration: 0s, args:
2022/02/12 06:06:51 Shell duration: 0s, args:
2022/02/12 06:06:51 debug: Getenv

2022/02/12 06:06:51 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 debug: Getenv

2022/02/12 06:06:51 Getenv duration: 0s, args: SSH_CONNECTION
2022/02/12 06:06:51 debug: Getenv

2022/02/12 06:06:51 Getenv duration: 0s, args: SSH_CLIENT
2022/02/12 06:06:51 Root duration: 13.4µs, args:
2022/02/12 06:06:51 Shell duration: 0s, args:
2022/02/12 06:06:51 ErrorCode duration: 0s, args:
2022/02/12 06:06:51 IsWsl duration: 0s, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 User duration: 0s, args:
2022/02/12 06:06:51 Host duration: 0s, args:
2022/02/12 06:06:51 GOOS duration: 0s, args:
2022/02/12 06:06:51 TemplateCache duration: 13.4µs, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 Args duration: 0s, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 GOOS duration: 0s, args:
2022/02/12 06:06:51 GOOS duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 PathSeperator duration: 0s, args:
2022/02/12 06:06:51 GOOS duration: 0s, args:
2022/02/12 06:06:51 IsWsl duration: 0s, args:
2022/02/12 06:06:51 StackCount duration: 0s, args:
2022/02/12 06:06:51 TemplateCache duration: 0s, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 Shell duration: 0s, args:
2022/02/12 06:06:51 TemplateCache duration: 0s, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 TemplateCache duration: 0s, args:
2022/02/12 06:06:51 debug: Pwd
I:\Projects\Rust\game
2022/02/12 06:06:51 Pwd duration: 0s, args:
2022/02/12 06:06:51 debug: Home
C:\Users\lamia
2022/02/12 06:06:51 ErrorCode duration: 0s, args:
2022/02/12 06:06:51 TemplateCache duration: 0s, args:
2022/02/12 06:06:51 TemplateCache duration: 0s, args:
2022/02/12 06:06:51 TemplateCache duration: 0s, args:
2022/02/12 06:06:51 debug: Getenv
C:\Users\lamia\AppData\Local
2022/02/12 06:06:51 Getenv duration: 0s, args: LOCALAPPDATA
2022/02/12 06:06:51 CachePath duration: 0s, args:
JanDeDobbeleer commented 2 years ago

@A-Lamia yes, that's because initially we stripped ANSI from the text, which was nowhere an issue but here it seems as posh-git provides an ANSI string. I'll see what we can do.

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