lyze / posh-git-sh

Bash/ZSH version of the posh-git command prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Very slow compared to Powershell posh-git

Mrazator opened this issue · comments

Hey,

I just installed it and it seems that it does the trick, but it is very slow compared to powershell's posh-git. After each pressed 'enter' in the console I have to wait ca 3 sec or more to actually give me a new (re-counted) line. Is this normal behavior?

Currently it seems to be pretty slow (I am using WSL v1.) compared to git in powershell. But TBH I don't remember how fast/slow it was on back then, when I was trying out this extension. It might be the reason behind this extreme snowlines or might not. Not sure.

Yes I am using WSL 2 and it is very slow on there when the git files are on the mounted C:\ drive. This is a git problem though, which is a known WSL performance problem when using /mnt files: microsoft/WSL#4197

I am using Ubuntu 20 in WSL2. Thanks for porting this very useful tool!

Small detail: I noticed that after installing it and sourcing .bashrc, the initial coloring of the user name, host and the rest of the previous prompt is not colored anymore. That's a very minor issue, but if somebody knows how to fix it, thanks in advance :)

I am using Ubuntu 20 in WSL2. Thanks for porting this very useful tool!

Small detail: I noticed that after installing it and sourcing .bashrc, the initial coloring of the user name, host and the rest of the previous prompt is not colored anymore. That's a very minor issue, but if somebody knows how to fix it, thanks in advance :)

I have a fairly ordinary prompt with Ubuntu.

david@Crunchmaster:~$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

Not seeing color might be as intended, since the README suggests

PROMPT_COMMAND='__posh_git_ps1 "\u@\h:\w " "\\\$ ";'$PROMPT_COMMAND

which doesn't have the color codes. Perhaps you may want to do something like this:

PROMPT_COMMAND='__posh_git_ps1 "\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w " "\[\033[00m\]\$"'

image

It works fine! Thank you very much, not only for giving me the solution, but to allow me to understand how color display works! 😊

This tool makes my daily tasks much more easier : I am an anxious guy and always scared of working on the wrong branch, or forgetting to push my changes... :)

I've solved slow working in WSL2 on mounted windows filesystems by exiting early when $PWD starts with /mnt. That way I can use it in WSL2 bash on native linux fs and do not wait forever if i need to check something on windows fs from bash.

I can create PR with some kind of env variable (POSHGIT_EXCLUDE?) if anyone is interested.

I have no need currently. I ended up re-cloning the repos directly into the WSL2 filesystem and stopped using anything on Windows mount. That performed perfectly for me.