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

glitchy terminal #2450

Closed amine-aboufirass closed 2 years ago

amine-aboufirass commented 2 years ago

Code of Conduct

What happened?

Every now and then, the terminal exhibits behavior in which multiple prompts appear. Only one of them remains active, and the "dead" prompt drops out if I resize the terminal pane (Shift+Alt+Down or Shift+Alt+Up) and then type in clear and enter.

This seems to happen more frequently when I exit out of vim, but I believe it can also happen without vim. It's very difficult to predict when or why it happens. Here's a photo of what I'm referring to:

image

Theme

I have my own custom theme:

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "lightBlue",
          "foreground": "black",
          "properties": {
            "style": "folder"
          },
          "style": "diamond",
          "template": " {{ .Path }} ",
          "type": "path"
        },
        {
          "background": "#906cff",
          "foreground": "#100e23",
          "properties": {
            "fetch_version": false
          },
          "style": "powerline",
          "template": "({{ if .Error }}{{.Error}}{{ else }}{{ if .Venv }}{{.Venv}}{{ end }}{{.Full}}{{ end }})",
          "type": "python"
        },
        {
          "background": "green",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}yellow{{ end }}"
          ],
          "foreground": "black",
          "properties": {
            "branch_ahead_icon": "",
            "branch_behind_icon": "",
            "branch_gone": "",
            "branch_icon": "",
            "branch_identical_icon": "",
            "cherry_pick_icon": "",
            "commit_icon": "",
            "fetch_status": true,
            "merge_icon": "",
            "no_commits_icon": "[no commits]",
            "rebase_icon": "",
            "tag_icon": ""
          },
          "style": "powerline",
          "template": " {{ .HEAD }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }} ",
          "type": "git"
        }
      ],
      "type": "prompt"
    }
  ],
  "console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}} :: {{.Shell}}",
  "final_space": true,
  "osc99": true,
  "version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 7.77.0

Segments:

ConsoleTitle(true) -   0 ms - cs-jumpstart :: pwsh
path(true)    -   0 ms -  cs-jumpstart 
python(false) -   0 ms - 
git(false)    -  33 ms - 

Run duration: 33.4798ms

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

Logs:

2022/06/28 10:43:38 Flags duration: 0s, args: 
2022/06/28 10:43:38 Flags duration: 0s, args: 
2022/06/28 10:43:38 debug: Getenv

2022/06/28 10:43:38 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/06/28 10:43:38 Root duration: 0s, args: 
2022/06/28 10:43:38 Shell duration: 0s, args: 
2022/06/28 10:43:38 ErrorCode duration: 0s, args: 
2022/06/28 10:43:38 IsWsl duration: 0s, args: 
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 debug: Home
C:\Users\aa
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 debug: User
aa
2022/06/28 10:43:38 User duration: 0s, args: 
2022/06/28 10:43:38 debug: Host
2204092-ANL
2022/06/28 10:43:38 Host duration: 0s, args: 
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 TemplateCache duration: 0s, args: 
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 debug: Home
C:\Users\aa
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 Flags duration: 0s, args: 
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 debug: Home
C:\Users\aa
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 PathSeparator duration: 0s, args: 
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 IsWsl duration: 0s, args: 
2022/06/28 10:43:38 StackCount duration: 0s, args: 
2022/06/28 10:43:38 TemplateCache duration: 0s, args: 
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 debug: Home
C:\Users\aa
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 debug: Home
C:\Users\aa
2022/06/28 10:43:38 debug: Getenv

2022/06/28 10:43:38 Getenv duration: 0s, args: VIRTUAL_ENV
2022/06/28 10:43:38 debug: Getenv

2022/06/28 10:43:38 Getenv duration: 0s, args: CONDA_ENV_PATH
2022/06/28 10:43:38 debug: Getenv

2022/06/28 10:43:38 Getenv duration: 0s, args: CONDA_DEFAULT_ENV
2022/06/28 10:43:38 debug: Pwd
C:\Users\a\Desktaop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 debug: Home
C:\Users\aa
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 GOOS duration: 0s, args: 
2022/06/28 10:43:38 HasCommand duration: 32.9267ms, args: git.exe
2022/06/28 10:43:38 debug: Pwd
C:\Users\aa\Desktop\cs-jumpstart
2022/06/28 10:43:38 Pwd duration: 0s, args: 
2022/06/28 10:43:38 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/06/28 10:43:38 HasParentFilePath duration: 553.1Γö¼Γòís, args: .git
2022/06/28 10:43:38 debug: Getenv
C:\Users\aa\AppData\Local
2022/06/28 10:43:38 Getenv duration: 0s, args: LOCALAPPDATA
2022/06/28 10:43:38 CachePath duration: 0s, args: 
JanDeDobbeleer commented 2 years ago

@awa5114 as PowerShell is responsible for rendering/displaying the prompt, this is not a bug on our end. We only tell PowerShell what to render, not when to render it.

amine-aboufirass commented 2 years ago

Upon second thought, I'm pretty sure this is the windows implementation of Vim.

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