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 tab completion doesn't work if you specify arguments/options #9730

Closed
gcs278 opened this issue Mar 17, 2021 · 9 comments · Fixed by #10852
Closed

Bash tab completion doesn't work if you specify arguments/options #9730

gcs278 opened this issue Mar 17, 2021 · 9 comments · Fixed by #10852
Assignees
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

@gcs278
Copy link

gcs278 commented Mar 17, 2021

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

/kind bug

Description

Bash tab completion works for the most part in podman, but if you have an argument or option flags, it breaks the completion. Take podman exec for example. podman exec <tab> works, but podman exec -it <tab> does not.

Docker does successfully tab with arguments (like docker exec -it <tab>). This might seem harmless, but does make rapid development a little more difficult as I use podman exec -it container bash a lot to jump into my containers.

Steps to reproduce the issue:

  1. podman exec -it <tab>

Describe the results you received:

It auto completes to the normal bash filesystem

Describe the results you expected:

A listing of the available containers just like podman exec <tab>

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:      3.0.0-dev
API Version:  3.0.0
Go Version:   go1.15.7
Built:        Tue Feb  2 17:06:33 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.19.2
  cgroupManager: systemd
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.25-1.module_el8.4.0+673+eabfc99d.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: 897f4ebd69b9e9c725621fabf1d7c918ef635a68'
  cpus: 10
  distribution:
    distribution: '"rhel"'
    version: "8.0"
  eventLogger: file
  hostname: rhel8
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.18.0-80.el8.x86_64
  linkmode: dynamic
  memFree: 393658368
  memTotal: 10055262208
  ociRuntime:
    name: crun
    package: crun-0.17-1.module_el8.4.0+673+eabfc99d.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.17
      commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_NET_RAW,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 0
  swapTotal: 0
  uptime: 5696h 37m 42.4s (Approximately 237.33 days)
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 12
    paused: 0
    running: 1
    stopped: 11
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /root/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 6
  runRoot: /root/containers/runroot/storage
  volumePath: /root/containers/storage/volumes
version:
  APIVersion: 3.0.0
  Built: 1612303593
  BuiltTime: Tue Feb  2 17:06:33 2021
  GitCommit: ""
  GoVersion: go1.15.7
  OsArch: linux/amd64
  Version: 3.0.0-dev

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

podman-3.0.0-0.33rc2.module_el8.4.0+673+eabfc99d.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 17, 2021
@zhangguanzhang
Copy link
Collaborator

@Luap99 PTAL

@Luap99
Copy link
Member

Luap99 commented Mar 17, 2021

This is a know bug in the cobra library. I have opened a PR spf13/cobra#1258 to fix this this but unfortunately it is not merged yet. I know this is annoying. As a workaround I recommend using podman exec -i -t [TAB].

@mheon
Copy link
Member

mheon commented Mar 17, 2021

I'll assign @Luap99 so he remembers to close this whenever that Cobra issue closes.

Speaking of, we really need to get more attention on the Cobra PRs he has open.

@zhangguanzhang
Copy link
Collaborator

@Luap99 PTAL

@Luap99
Copy link
Member

Luap99 commented May 4, 2021

spf13/cobra#1258 has been merged upstream. A new cobra release is following soon (spf13/cobra#1388). Once this is done we can update podman.

@github-actions
Copy link

github-actions bot commented Jun 4, 2021

A friendly reminder that this issue had no activity for 30 days.

@Luap99
Copy link
Member

Luap99 commented Jun 4, 2021

Still waiting for a new cobra release.

@rhatdan
Copy link
Member

rhatdan commented Jun 7, 2021

@Luap99 any idea when this is going to happen? Is there someone we should nag?

@Luap99
Copy link
Member

Luap99 commented Jun 7, 2021

Hopefully soon, see spf13/cobra#1388

Luap99 added a commit to Luap99/libpod that referenced this issue Jul 1, 2021
Luap99 added a commit to Luap99/libpod that referenced this issue Jul 2, 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
6 participants