posh-git-sh icon indicating copy to clipboard operation
posh-git-sh copied to clipboard

Very slow compared to Powershell posh-git

Open Mrazator opened this issue 4 years ago • 7 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?

Mrazator avatar Apr 06 '20 12:04 Mrazator

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.

Mrazator avatar May 29 '20 14:05 Mrazator

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: https://github.com/microsoft/WSL/issues/4197

jonathanbass avatar May 29 '20 14:05 jonathanbass

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 :)

bgolinvaux avatar Aug 25 '20 15:08 bgolinvaux

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\]\$"'

lyze avatar Sep 11 '20 02:09 lyze

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... :)

bgolinvaux avatar Sep 12 '20 11:09 bgolinvaux

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.

ptasz3k avatar Apr 19 '22 10:04 ptasz3k

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.

jonathanbass avatar Apr 19 '22 14:04 jonathanbass