Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash completion is broken when readline menu-complete is used #12005

Closed
averms opened this issue Oct 17, 2021 · 3 comments
Closed

Bash completion is broken when readline menu-complete is used #12005

averms opened this issue Oct 17, 2021 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@averms
Copy link

averms commented Oct 17, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

When the tab button is used for menu-complete instead of complete with Readline the completion script adds the description of options to the completed line.

The relevant documentation for Readline.
StackOverflow answer that explains why menu-complete is so nice.

Steps to reproduce the issue:

  1. Add TAB: menu-complete to .inputrc.
  2. Open bash and type podman --c<TAB>
  3. Note that podman --cgroup-manager (Cgroup manager to use ("cgroupfs"|"systemd")) is added to the current line.
  4. Press enter and get bash: syntax error near unexpected token `('

Describe the results you received:

The description for the options is added to the completed line.

Describe the results you expected:

Only the actual option is added.

Output of podman version:

Version:      3.4.0
API Version:  3.4.0
Go Version:   go1.17.1
Git Commit:   6e8de00bb224f9931d7402648f0177e7357ed079
Built:        Fri Oct  1 06:14:18 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

Irrelevant

Package info (e.g. output of rpm -q podman or apt list podman):

Name            : podman
Version         : 3.4.0-1
Description     : Tool and library for running OCI-based containers in pods
Architecture    : x86_64
URL             : https://github.com/containers/podman
Licenses        : Apache
Groups          : None
Provides        : None
Depends On      : cni-plugins  conmon  containers-common  crun  fuse-overlayfs  iptables  libdevmapper.so=1.02-64  libgpgme.so=11-64  libseccomp.so=2-64  slirp4netns
Optional Deps   : apparmor: for AppArmor support
                  btrfs-progs: support btrfs backend devices [installed]
                  catatonit: --init flag support
                  podman-docker: for Docker-compatible CLI
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 72.66 MiB
Packager        : David Runge <dvzrv@archlinux.org>
Build Date      : Fri 01 Oct 2021 06:14:18 AM EDT
Install Date    : Sat 02 Oct 2021 08:23:11 PM EDT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 17, 2021
@Luap99
Copy link
Member

Luap99 commented Oct 18, 2021

Podman uses https://github.com/spf13/cobra to generate the shell completion scripts. Can you report the issue there? In the meantime you can create a shell completion script without the description information with podman completion bash --no-desc

@marckhouzam
Copy link

Should be fixed by spf13/cobra#1509

@Luap99
Copy link
Member

Luap99 commented Oct 19, 2021

Closing this issue because it will be fixed upstream and there is a workaround

@Luap99 Luap99 closed this as completed Oct 19, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

3 participants