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

Cannot disable detach keys by setting detach-keys to an empty string ("") #5166

Closed
junjieyuan opened this issue Feb 11, 2020 · 3 comments · Fixed by #5203
Closed

Cannot disable detach keys by setting detach-keys to an empty string ("") #5166

junjieyuan opened this issue Feb 11, 2020 · 3 comments · Fixed by #5203
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

@junjieyuan
Copy link

junjieyuan commented Feb 11, 2020

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

/kind bug

Description

This feature cannot be disabled after setting detach_keys to an empty string ("").

See also:

#4208

Steps to reproduce the issue:

1.podman run --env TERM=$TERM --detach-keys "" -it --rm registry.fedoraproject.org/f31/fedora-toolbox:31 /bin/bash

or

podman run --env TERM=$TERM --detach-keys="" -it --rm registry.fedoraproject.org/f31/fedora-toolbox:31 /bin/bash

or

edit ~/.config/containers/libpod.conf: detach_keys = ""

2.After entering ctrl-p, bash cannot directly display the previous command. After pressing other keys (for example, "e"), ctrl-p and e will be entered into the terminal. After pressing ctrl-p + ctrl-q, it will detach from the container.

Describe the results you received:

Detach keys is still "ctrl-p, ctrl-q".

Describe the results you expected:

This feature will be disabled.

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

Output of podman version:

podman version 1.8.0

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.13.6
  podman version: 1.8.0
host:
  BuildahVersion: 1.13.1
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.10-2.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.10, commit: 6b526d9888abb86b9e7de7dfdeec0da98ad32ee0'
  Distribution:
    distribution: fedora
    version: "31"
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  MemFree: 361185280
  MemTotal: 7919865856
  OCIRuntime:
    name: crun
    package: crun-0.12.1-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.12.1
      commit: df5f2b2369b3d9f36d175e1183b26e5cee55dd0a
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 7944531968
  SwapTotal: 8195665920
  arch: amd64
  cpus: 4
  eventlogger: journald
  hostname: xps
  kernel: 5.4.17-200.fc31.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-0.4.0-20.1.dev.gitbbd6f25.fc31.x86_64
    Version: |-
      slirp4netns version 0.4.0-beta.3+dev
      commit: bbd6f25c70d5db2a1cd3bfb0416a8db99a75ed7e
  uptime: 4h 44m 21.6s (Approximately 0.17 days)
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - quay.io
store:
  ConfigFile: /var/home/junjie/.config/containers/storage.conf
  ContainerStore:
    number: 2
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.7.5-2.fc31.x86_64
      Version: |-
        fusermount3 version: 3.6.2
        fuse-overlayfs: version 0.7.5
        FUSE library version 3.6.2
        using FUSE kernel interface version 7.29
  GraphRoot: /home/junjie/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 8
  RunRoot: /run/user/1000
  VolumePath: /home/junjie/.local/share/containers/storage/volumes

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

podman-1.8.0-2.fc31.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):
OS: Fedora Silverblue 31

[junjie@xps containers]$ rpm-ostree status
State: idle
AutomaticUpdates: disabled
Deployments:
● ostree://fedora:fedora/31/x86_64/silverblue
                   Version: 31.20200211.0 (2020-02-11T00:51:59Z)
                BaseCommit: 5401775ea020efd6ffc869ade0a0b695138a2d0603d098e59f0bd003009fdf43
              GPGSignature: Valid signature by 7D22D5867F2A4236474BF7B850CB390B3C3359C4
             LocalPackages: google-chrome-stable-80.0.3987.87-1.x86_64

  ostree://fedora:fedora/31/x86_64/silverblue
                   Version: 31.20200210.0 (2020-02-10T00:40:47Z)
                BaseCommit: 5d20cf79b4efde70a873d815015554f169f58085576aabcf4fe34c1ea54edf4e
              GPGSignature: Valid signature by 7D22D5867F2A4236474BF7B850CB390B3C3359C4
             LocalPackages: google-chrome-stable-80.0.3987.87-1.x86_64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 11, 2020
@junjieyuan
Copy link
Author

After setting detach-keys to other keys (for example: "ctrl-g, ctrl-g"), the detach keys will become ctrl-g + ctrl-g. It cannot be turned off by setting it to an empty string.

@rhatdan
Copy link
Member

rhatdan commented Feb 11, 2020

I wonder if the OCI Runtimes set the detach keys if they are set to ""

@mheon
Copy link
Member

mheon commented Feb 11, 2020

This isn't the runtime, they don't have any interaction - this is all Podman

QiWang19 added a commit to QiWang19/podman that referenced this issue Feb 13, 2020
fix containers#5166
This patch enables `--detach-keys ""` to disable the feature. "ctrl-p, ctrl-q" will not work after this command.

Signed-off-by: Qi Wang <qiwan@redhat.com>
QiWang19 added a commit to QiWang19/podman that referenced this issue Feb 13, 2020
fix containers#5166
This patch enables `--detach-keys ""` to disable the feature. "ctrl-p, ctrl-q" will not work after this command.

Signed-off-by: Qi Wang <qiwan@redhat.com>
snj33v pushed a commit to snj33v/libpod that referenced this issue May 31, 2020
fix containers#5166
This patch enables `--detach-keys ""` to disable the feature. "ctrl-p, ctrl-q" will not work after this command.

Signed-off-by: Qi Wang <qiwan@redhat.com>
debarshiray pushed a commit to HarryMichal/toolbox that referenced this issue Sep 2, 2020
Podman sets 'ctrl-p ctrl-q' as the default key sequence for detaching
a container. This breaks the ctrl-p shortcut that's equivalent to the
up arrow key in GNU Readline environments like Bash and Emacs.
Moreoever, toolbox containers aren't meant to be detached in the first
place.

Since Podman 1.8.1, it is now possible to unset the key sequence for
detaching [2, 3].

[0] https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC15

[1] https://www.gnu.org/software/emacs/tour/

[2] Podman commit 7c623bd41ff3d534
    containers/podman#4208

[3] Podman commit ebfd253fc658ffc9
    containers/podman#5166

containers#394
likan999 pushed a commit to likan999/ppa-toolbox that referenced this issue Oct 30, 2020
Podman sets 'ctrl-p ctrl-q' as the default key sequence for detaching
a container. This breaks the ctrl-p shortcut that's equivalent to the
up arrow key in GNU Readline environments like Bash and Emacs.
Moreoever, toolbox containers aren't meant to be detached in the first
place.

Since Podman 1.8.1, it is now possible to unset the key sequence for
detaching [2, 3].

[0] https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC15

[1] https://www.gnu.org/software/emacs/tour/

[2] Podman commit 7c623bd41ff3d534
    containers/podman#4208

[3] Podman commit ebfd253fc658ffc9
    containers/podman#5166

containers#394
@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 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

Successfully merging a pull request may close this issue.

5 participants