dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.7k stars 801 forks source link

Tab auto completion stopped working #966

Closed realrubberduckdev closed 10 months ago

realrubberduckdev commented 10 months ago

System Details

$PROFILE file has

Import-Module 'C:\tools\poshgit\dahlbyk-posh-git-9bda399\src\posh-git.psd1'

Issue Description

Tab auto-completion has stopped working.

e.g. git check feat<hit tab> doesn't complete to git checkout feature/something

It used to work for me, and I'm unsure what has caused this. I have not done any recent upgrade of posh-git. Is it the Powershell version? I do remember installing a pwsh update.

Tried upgrading, still have the same issue

choco upgrade poshgit

Tried reinstalling poshgit, still have the same issue

choco uninstall poshgit
choco install poshgit

Apologies for lack of details as I am a bit lost as to why it has suddenly stopped working.

realrubberduckdev commented 10 months ago

Andrei helped me figure this out.

The latest version 1.1.0 of posh-git doesn't get installed via choco.

So added this to $PROFILE and tab completion now works

# install and import poshgit
if (-Not $(Get-Module -ListAvailable -Name posh-git)){
     Install-Module posh-git -RequiredVersion 1.1.0 -Scope CurrentUser -Force
}

Import-Module posh-git