Closed LuuKhoaHoc closed 10 months ago
with me it triggered and told me update new version, and then it still not work. I deleted remove all module from before ver in Powershell module at Document then Reinstall that. It still not work.
You removed all the modules, and they included PSCompletions? If not,You can try removing PSCompletions by running 'Uninstall-Module PSCompletions' and reinstall it.
Yes, i did it, but im reinstall all of this but still now work
Oh it get some error when i reinstall PSComplete
I can't reappear this bug. We do the same thing, but the results are different.
Still error bro. It told me update to 3.0.3 then i press enter and this happend
Are you using Windows Powershell? The problem is a lack of permissions. You should follow the prompts and use -Scope or restart the command line with administrator privileges.
Im using Window powershell bro, this my $NOTEPAD It have any problem?
It's not their problem. It's that in Windows PowerShell, you need to have enough permissions to install and update PowerShell modules smoothly.
I just updated and this appear
But still not working
Maybe I know. Do you try running the following command and see what the result is? $PSCompletions.fn_download_list()
That is result
I need you to change some code,Since I can't reappear the bug. Change the 148-line throw statement to throw $_
Still not work :(
What I need is the error message after the change.
I didn't get an error message
Are you have ultraview or something else?, help me fix that bro. I really want use PSComplete
It should be an unexpected error in the first initialization that caused something to be lost. I need to check some directory structures. Is it different from mine?
We are same bro
I'm using Windows Terminal. But that shouldn't be a problem, and I tested it on several other computers and PowerShell under Linux.
I try to remove PSComplete and i still can add git after that Im using window terminal ver 7.4 too and im using Window 11 too
Try to run 'Uninstall-Module PSCompletions'?
Ok i just uninstall it and that work. Let me try reinstall
What's the latest situation? After my testing, when there are some old versions in a module, it may make the install, uninstall, and remove commands invalid. I suggest you just delete the PSCompletions folder and then reinstall it.
still not work bro :(. I alse delete the PSCompletions folder for every time when i use Remove-Module not work
Now, after you delete it, can you restart powershell and use psc command normally? Do you get errors like I do?
Yes, that sure bro
If you reinstall the module now, it won't report the previous error, just it don't work?
Full height of report after reinstall PSCompletion
That's the problem here, but it seems that it will only appear on your computer
Try to run the following command and see the result: $PSCompletions.fn_get_config()
It should output :
from me
I simulated your environment and found that when I import it, my psc didn't work anymore. There may be a conflict between them.
When I import it,I reappear the bug here.
Oh god, that why, i will try now
It work bro, thank a lot. <3 Im really happy. Thank you very much 🥰😭.
For their conflicts, I'll deal with them in the next release. I hope PSCompletions can help your work.
Thank you very much, it help a lot. I will close issue after this comment
遇到同样的问题。跟随这个教程跑了一遍,然后才发现大佬的PSCompletions。再使用PSCompletions后tab展示的内容类似上面的反馈,请问大佬,是不是同样的原因导致冲突了,如何消除这个冲突
使用的平台呢?Windows? Linux? 使用的是 Powershell 还是 Windows Powershell? 有无报错信息?
没有报错,除了tab不行,其他看起来都没问题,下面是我的脚本文件。 之前代码中有Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete。 我尝试了Remove-PSReadlineKeyHandler -Key Tab,但是也没恢复正常
平台是window 10,工具是Windows terminal,terminal中配置的是power shell
Powershell的版本呢?
我这里的测试是完全没有问题的,我的配置文件只有这两行也能正常工作。 你的配置文件是否还包含了其他的内容,我需要看一看你完整的配置文件
power shell版本看起来是有些低。
完整代码如下,其他代码是用于展示当前分支的,不会影响提示
function Write-BranchName () {
try {
$branch = git rev-parse --abbrev-ref HEAD
if ($branch -eq "HEAD") {
# we're probably in detached HEAD state, so print the SHA
$branch = git rev-parse --short HEAD
Write-Host " ($branch)" -ForegroundColor "red"
}
else {
# we're on an actual branch, so print it
Write-Host " ($branch)" -ForegroundColor "blue"
}
} catch {
# we'll end up here if we're in a newly initiated git repo
Write-Host " (no branches yet)" -ForegroundColor "yellow"
}
}
function prompt {
$base = "PS "
$path = "$($executionContext.SessionState.Path.CurrentLocation)"
$userPrompt = "$('>' * ($nestedPromptLevel + 1)) "
Write-Host "`n$base" -NoNewline
if (Test-Path .git) {
Write-Host $path -NoNewline -ForegroundColor "green"
Write-BranchName
}
else {
# we're not in a repo so don't bother displaying branch name/sha
Write-Host $path -ForegroundColor "green"
}
return $userPrompt
}
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
# Shows navigable menu of all options when hitting Tab
# Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# Autocompletion for arrow keys
# Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
# Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
# auto suggestions
Import-Module PSCompletions
Set-PSReadLineOption -PredictionSource History
Import-Module PSReadLine
I followed you to add install PSC and Import PSC to PWSH, all thing ok but when i type psc and press space then tab. It's not working at well