diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ba89b0cc..9998e0733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # posh-git Release History +## 1.0.0 - TBD + +### Fixed + +- Register-ArgumentCompleter based tab-expansion in beta4 doesn't work with PowerShell aliases to git,tgit,gitk. + ([#769](https://github.com/dahlbyk/posh-git/issues/769)) + ([PR #770](https://github.com/dahlbyk/posh-git/pull/770)) + ## 1.0.0-beta4 - March 14, 2020 ### Added diff --git a/src/GitTabExpansion.ps1 b/src/GitTabExpansion.ps1 index 3c733aaa8..7104c59a0 100644 --- a/src/GitTabExpansion.ps1 +++ b/src/GitTabExpansion.ps1 @@ -480,7 +480,10 @@ function WriteTabExpLog([string] $Message) { } if (!$UseLegacyTabExpansion -and ($PSVersionTable.PSVersion.Major -ge 6)) { - Microsoft.PowerShell.Core\Register-ArgumentCompleter -CommandName git,tgit,gitk -Native -ScriptBlock { + $cmdNames = "git","tgit","gitk" + $cmdNames += Get-Alias -Definition $cmdNames -ErrorAction Ignore | ForEach-Object Name + + Microsoft.PowerShell.Core\Register-ArgumentCompleter -CommandName $cmdNames -Native -ScriptBlock { param($wordToComplete, $commandAst, $cursorPosition) # The PowerShell completion has a habit of stripping the trailing space when completing: