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

Posh-git not display well in my powershell

Open pharazone opened this issue 4 years ago • 8 comments

image

System Details

  • posh-git version/path: 0.7
  • PowerShell version: 5.1.19631.1
  • Git version: 2.18.0.windows.1
  • Operating system name and version: windows 10 2004

Issue Description

As the picture, there is a long blank before ">" and the script, how could I solve this? Thank you!

pharazone avatar May 26 '20 13:05 pharazone

I am having a similar problem as @pharazone. Only Posh-Git isn't indicating anything, for me, as far as being in a git repo. However, I am in a git repo as doing a git status shows:

Annotation 2020-06-06 162339

System Details

  • (I don't know how to get the version of posh-git)
  • PowerShell version: 5.1.18362.752
  • Git version: 2.27.0.windows.1
  • Operating system and version: Windows 10 Pro 1909

rfalanga avatar Jun 06 '20 22:06 rfalanga

To get the version of posh-git, run Get-Module. Also, have you imported posh-git?

rkeithhill avatar Jun 07 '20 00:06 rkeithhill

Thank you for supplying me with the Get-Module command. I've issued both Get-Module posh-git and Get-Module poshgit (since I'm not sure which I should be using). It produces nothing.

I'm guessing I've failed to import posh-git. I'm sorry, I'm enough of a novice to now know how I should import it.

rfalanga avatar Jun 07 '20 01:06 rfalanga

@rfalanga No worries. Once you've imported it, you can run the Add-PoshGitToProfile -AllHosts so that the next time you start PowerShell, posh-git will auomatically get imported.

rkeithhill avatar Jun 07 '20 04:06 rkeithhill

@rkeithhill thank you very much for your help!

I believe I've imported it. I've just ran Add-PoshGitToProfile -AllHosts, but got this warning:

WARNING: Skipping add of posh-git import to file 'C:\Users\rodf\OneDrive\Documents\WindowsPowerShell\profile.ps1'. WARNING: posh-git appears to already be imported in one of your profile scripts. WARNING: If you want to force the add, use the -Force parameter.

What should I do about this?

rfalanga avatar Jun 07 '20 05:06 rfalanga

Thank you again, @rkeithhill, that took care of it.

rfalanga avatar Jun 07 '20 14:06 rfalanga

What should I do about this?

Those warnings were just telling you that your profile already imports posh-git. So you're set.

rkeithhill avatar Jun 07 '20 17:06 rkeithhill

@pharazone What environment are you running in? Is that the PS Console, PS in Windows Terminal, PS in VSCode Terminal, PS in VSCode PS Integrated Console or something else?

rkeithhill avatar Jun 07 '20 17:06 rkeithhill