Open goldman7911 opened 2 years ago
@n1hility PTAL
@goldman7911 so it used to work, but does not anymore?
@goldman7911 so it used to work, but does not anymore?
Yes, unfortunelly I don't know which version exactly. I used to let Windows in latest version and run winget upgrade --all. Now I try even manually and can't make it work for pwsh (even using other pwsh versions)
A friendly reminder that this issue had no activity for 30 days.
@baude are you still looking at this one? @cdoern was looking for some low-hanging fruit, this looks like one
@baude you probably already determined this, but to help point in the right direction, cobra seems to have a bug where it expects program name to not have a dot:
https://github.com/spf13/cobra/blob/main/powershell_completions.go#L109
This results in the powershell output:
$env:PODMAN.EXE_ACTIVE_HELP=0
With powershell, you can't have a dot in env names, needs to look like:
${env:PODMAN.EXE_ACTIVE_HELP}=0
A friendly reminder that this issue had no activity for 30 days.
@baude @cdoern @n1hility could we get an update on this?
hi @cdoern I see the commit above looks like you have the fix for this. Are you planning to open a PR for this to the cobra project?
I fixed the bugs that were in the generated script from running podman.exe completion powershell | Out-String | Invoke-Expression
on Podman version 4.4.2 on Windows 11.
I had to zip it because powershell scripts are supported in comments. Sorry for the laziness.
A temporary workaround would be using a modified command in the $PROFILE instead of the one in the manual. Like this one :
$(podman completion powershell | Out-String).Replace('podman.exe','podman').Replace('PODMAN.EXE','PODMAN') | Invoke-Expression
It just removes the ".exe" that is added after "podman" by cobra, turning "podman.exeCompleterBlock" into "podmanCompleterBlock" which doesn't crash. Works well for me in the latest podman version with powershell 5.1 or 7.2 and windows 10 (pro).
Came here with the same issue. Can someone explain why cobra generates the completion specifically for podman.exe
and not podman
? I am curious, because oh-my-posh also uses cobra and oh-my-posh completion powershell
does not create a completion for oh-my-posh.exe
.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman completion stopped worked
Steps to reproduce the issue:
podman.exe machi
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Microsoft Windows 11 Pro 10.0.22000 N/A compilação 22000 Windows Terminal 1.14.2282.0 Oh My Posh version 8.35.0
pwsh $PROFILE