Giter Site home page Giter Site logo

Comments (19)

mezdelex avatar mezdelex commented on August 22, 2024 1

image
It's actually the Vi mode... u_u

@JanDeDobbeleer thanks for the walkthrough, may I close the issue?

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex which scoop install is this? We don't have that one in our docs, the one you need to use is:

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

@mezdelex which scoop install is this? We don't have that one in our docs, the one you need to use is:

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json

the one not rendering the path, git and language server info is the last version scoop install oh-my-posh. The expected one was after installing a random previous version scoop install oh-my-posh@{theShownVersion}.

In the first screenshot I'm in the same directory as in the Expected one (nvim) .

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex I know, but that scoop package isn't maintained by me. Can you remove that and install using one of the official means of installation?

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

@JanDeDobbeleer
image
I uninstalled the package with scoop uninstall oh-my-posh and installed with scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json and got the same result.

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex this makes no sense at all, even with that scoop version I can't reproduce this. At all. Also, the path segment has no conditional ability, you add it, it's there.

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex can you share your full configuration?

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

Sure, here's what I'm using

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#FB4934",
          "style": "plain",
          "template": "󱐋 ",
          "type": "root"
        },
        {
          "foreground": "#83A598",
          "properties": {
            "folder_icon": "",
            "folder_separator_icon": "󰿟",
            "home_icon": "",
            "style": "mixed"
          },
          "style": "plain",
          "template": "{{ .Path }}",
          "type": "path"
        },
        {
          "foreground": "#B8BB26",
          "foreground_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#FABD2F{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FB4934{{ end }}",
            "{{ if gt .Ahead 0 }}#FB4934{{ end }}",
            "{{ if gt .Behind 0 }}#FABD2F{{ end }}"
          ],
          "properties": {
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "github_icon": " "
          },
          "style": "plain",
          "template": " on {{ .UpstreamIcon }}{{ .HEAD }}{{ if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} <#FB4934> {{ .Working.String }}</>{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} <#FABD2F> {{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0 }} 󰆓 {{ .StashCount }}{{ end }}",
          "type": "git"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "right",
      "segments": [
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Angular[]{{ .Full }}",
          "type": "angular"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " .NET[]{{ .Full }}",
          "type": "dotnet"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Go[󰟓]{{ .Full }}",
          "type": "go"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Haskell[]{{ .Full }}",
          "type": "haskell"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Java[]{{ .Full }}",
          "type": "java"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Kotlin[]{{ .Full }}",
          "type": "kotlin"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Lua[]{{ .Full }}",
          "type": "lua"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Node[]{{ .Full }}",
          "type": "node"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " PHP[]{{ .Full }}",
          "type": "php"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Python[]{{ .Full }}",
          "type": "python"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " React[]{{ .Full }}",
          "type": "react"
        },
        {
          "foreground": "#D3869B",
          "properties": {
            "display_mode": "files"
          },
          "style": "plain",
          "template": " Rust[]{{ .Full }}",
          "type": "rust"
        },
        {
          "foreground": "#8EC07C",
          "style": "plain",
          "template": " RAM[󰍛]{{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)) 1000000000) }}/{{ (div .PhysicalTotalMemory 1000000000) }}GB",
          "type": "sysinfo"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#FABD2F",
          "properties": {
            "time_format": "15:04:05"
          },
          "style": "plain",
          "template": "{{ .CurrentDate | date .Format }} ",
          "type": "time"
        },
        {
          "foreground": "#FABD2F",
          "properties": {
            "threshold": 0
          },
          "style": "plain",
          "template": "󰔛 {{ .FormattedMs }} ",
          "type": "executiontime"
        },
        {
          "foreground": "#83A598",
          "style": "plain",
          "template": "",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "final_space": true,
  "version": 2
}

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex with your config, using that version of scoop you reported the issue with:

image

Can you do me a favour and try the full path when using oh-my-posh init like I do in my screenshot?

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

@JanDeDobbeleer here's the pwsh profile I use:

Import-Module -Name Terminal-Icons

Invoke-Expression (&oh-my-posh init powershell -c ~/.mezdelex.omp.json)
Invoke-Expression (&{(zoxide init powershell | Out-String)})

Set-PSReadLineOption -BellStyle None
Set-PSReadLineOption -EditMode Vi
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView

Set-PSReadLineKeyHandler -Key "ctrl+n" -Function NextHistory
Set-PSReadLineKeyHandler -Key "ctrl+p" -Function PreviousHistory
Set-PsFzfOption -PSReadlineChordProvider "ctrl+f"
Set-PsFzfOption -PSReadlineChordReverseHistory "ctrl+r"

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex that's not what I asked, I want to rule out everything as I can't solve it unless I know what's causing this. In the code we have nothing that could do this, so something else is off, and of the two people who reported this, both of you use scoop the same way. If this was a code issue we would see a lot more reports (and I could easily reproduce it as well).

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

@mezdelex that's not what I asked, I want to rule out everything as I can't solve it unless I know what's causing this. In the code we have nothing that could do this, so something else is off, and of the two people who reported this, both of you use scoop the same way. If this was a code issue we would see a lot more reports (and I could easily reproduce it as well).

image
Hm, there's no oh-my-posh.exe in the current directory whatsoever. There's only install.json and manifest.json

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex interesting, I want to bet there's something off with scoop here. What does get-command oh-my-posh say?

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

image

That's it, I've uninstalled oh-my-posh and reinstalled again the 21.26.0 and it generates the .exe file correctly in the scoop apps directory (and themes directory as well btw).

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex when you only keep the oh-my-posh init line in your profile, do you still get the same behavior?

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

@mezdelex when you only keep the oh-my-posh init line in your profile, do you still get the same behavior?

Nope, it actually works perfectly when there's only that line in the .ps1 even if the generated files are in that weird path (Programs/oh-my-posh/bin/oh-my-posh.exe)

putting both inits at the end of the ps1 solves the problem and everything works, despite the directory issue.

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex Now we're getting somewhere. Something is messing with the $PWD variable (or other path information). Can you re-enable until you find the culprit?

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on August 22, 2024

@mezdelex I'm quite certain zoxide is the one messing with PowerShell internals here.

from oh-my-posh.

mezdelex avatar mezdelex commented on August 22, 2024

image
If I keep them in the same order but comment Set-PSReadLineOption everything works as well.

from oh-my-posh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.