JanDeDobbeleer / oh-my-posh

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

Empty spaces in promt on startup #1973

Closed pitgrap closed 2 years ago

pitgrap commented 2 years ago

Code of Conduct

What happened?

I'm using oh-my-posh with WSL2 (Ubuntu) in a latest Windows Terminal (Win10). Installed via brew. Nerdfonts (Caskaydia Cove) is installed. Everything works fine, but on startup there are empty spaces in the prompt. After hitting enter, or doing anything in the terminal it looks good again. This is not a big deal, but somehow it disturbes me. ;)

Screenshot 2022-03-23 144446

A separate oh-my-posh in the powershell does not have this problem.

Theme

pradadox, but happens with every theme.

What OS are you seeing the problem on?

Windows, Linux

Which shell are you using?

bash

Log output

❯ oh-my-posh prompt debug

Version: 7.46.2

Segments:

ConsoleTitle(false)  -   0 ms -
executiontime(true)  -   0 ms -
root(false)          -   0 ms -
session(true)        -   0 ms -  mriehema@CM-BPZ26J3
path(true)           -   1 ms -  ~  dev
git(false)           -   0 ms -
python(false)        -   0 ms -
exit(false)          -   0 ms -
text(true)           -   0 ms - ❯

Run duration: 3.950035ms

Cache path: /home/mriehema/.cache/oh-my-posh

Logs:

2022/03/23 14:45:37 Flags duration: 92ns, args:
2022/03/23 14:45:37 Flags duration: 233ns, args:
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 6.2µs, args: OMP_CACHE_DISABLED
2022/03/23 14:45:37 Root duration: 372ns, args:
2022/03/23 14:45:37 Shell duration: 615.319µs, args:
2022/03/23 14:45:37 ErrorCode duration: 48ns, args:
2022/03/23 14:45:37 debug: Getenv
Ubuntu
2022/03/23 14:45:37 Getenv duration: 1.428µs, args: WSL_DISTRO_NAME
2022/03/23 14:45:37 IsWsl duration: 6.74µs, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 31.447µs, args:
2022/03/23 14:45:37 PathSeparator duration: 51ns, args:
2022/03/23 14:45:37 PathSeparator duration: 29ns, args:
2022/03/23 14:45:37 PathSeparator duration: 18ns, args:
2022/03/23 14:45:37 PathSeparator duration: 17ns, args:
2022/03/23 14:45:37 PathSeparator duration: 17ns, args:
2022/03/23 14:45:37 User duration: 130ns, args:
2022/03/23 14:45:37 Host duration: 903ns, args:
2022/03/23 14:45:37 GOOS duration: 51ns, args:
2022/03/23 14:45:37 TemplateCache duration: 681.337µs, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 916ns, args:
2022/03/23 14:45:37 ExecutionTime duration: 52ns, args:
2022/03/23 14:45:37 TemplateCache duration: 134ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 1.076µs, args:
2022/03/23 14:45:37 Root duration: 246ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 778ns, args:
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 691ns, args: SSH_CONNECTION
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 703ns, args: SSH_CLIENT
2022/03/23 14:45:37 TemplateCache duration: 127ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 1.073µs, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 401ns, args:
2022/03/23 14:45:37 Flags duration: 47ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 417ns, args:
2022/03/23 14:45:37 GOOS duration: 42ns, args:
2022/03/23 14:45:37 GOOS duration: 18ns, args:
2022/03/23 14:45:37 PathSeparator duration: 39ns, args:
2022/03/23 14:45:37 GOOS duration: 18ns, args:
2022/03/23 14:45:37 debug: Getenv
Ubuntu
2022/03/23 14:45:37 Getenv duration: 586ns, args: WSL_DISTRO_NAME
2022/03/23 14:45:37 IsWsl duration: 1.435µs, args:
2022/03/23 14:45:37 debug: RunCommand
//wsl$/Ubuntu/home/mriehema/dev
2022/03/23 14:45:37 RunCommand duration: 1.673259ms, args: wslpath -m /home/mriehema/dev
2022/03/23 14:45:37 StackCount duration: 54ns, args:
2022/03/23 14:45:37 TemplateCache duration: 207ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 1.25µs, args:
2022/03/23 14:45:37 debug: Getenv
Ubuntu
2022/03/23 14:45:37 Getenv duration: 612ns, args: WSL_DISTRO_NAME
2022/03/23 14:45:37 IsWsl duration: 1.698µs, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 4.664µs, args:
2022/03/23 14:45:37 GOOS duration: 45ns, args:
2022/03/23 14:45:37 HasCommand duration: 39.699µs, args: git
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 399ns, args:
2022/03/23 14:45:37 error: HasParentFilePath
stat /.git: no such file or directory
2022/03/23 14:45:37 HasParentFilePath duration: 6.271µs, args: .git
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 844ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 372ns, args:
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 722ns, args: VIRTUAL_ENV
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 504ns, args: CONDA_ENV_PATH
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 463ns, args: CONDA_DEFAULT_ENV
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 467ns, args: PYENV_VERSION
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 714ns, args:
2022/03/23 14:45:37 ErrorCode duration: 49ns, args:
2022/03/23 14:45:37 ErrorCode duration: 23ns, args:
2022/03/23 14:45:37 debug: Pwd
/home/mriehema/dev
2022/03/23 14:45:37 Pwd duration: 817ns, args:
2022/03/23 14:45:37 TemplateCache duration: 157ns, args:
2022/03/23 14:45:37 debug: Getenv

2022/03/23 14:45:37 Getenv duration: 718ns, args: XDG_CACHE_HOME
2022/03/23 14:45:37 CachePath duration: 9.928µs, args:
JanDeDobbeleer commented 2 years ago

@pitgrap that’s a known Windows Terminal bug. You can find more information and a fix here. Although the "startup" issue is related it only manifests once. Adding clear at the end of your profile also resolves it.

pitgrap commented 2 years ago

@pitgrap that’s a known Windows Terminal bug. You can find more information and a fix here.

I tried it, but it doesn't work. (Or I put the the codeblock on a wrong place in the theme json?).

Although the "startup" issue is related it only manifests once. Adding clear at the end of your profile also resolves it.

Haha, sometimes workarounds are so simple. 'DOH. Thank you so much for your fast feedback! Love it.

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.