Skip to content

Terminal keyboard "^p" input not passed directly to interactive processes #18708

@philregier

Description

@philregier

Issue Description

(The title may not be perfectly precise; I've had some trouble determining exactly where the keystrokes get held)

On several versions, including 3.4.4 and 3.5.0, on several hosts (tested by myself on SUSE Leap, Enterprise, and Tumbleweed and by hearsay on Fedora) and several guests (I've tried multiple SUSE releases, as well as Fedora from its own registry and Ubuntu from docker.io) I've found that multiple shells that use the Emacs-style c-p key for previous history line only respond to this key in pairs.

Steps to reproduce the issue

  1. Start an interactive terminal session in a base container image:
podman run -it registry.opensuse.org/opensuse/leap:latest
  1. Enter any two or more distinct inputs:
8f84e4b56b90:/ # a
bash: a: command not found
8f84e4b56b90:/ # b
bash: b: command not found
8f84e4b56b90:/ # c
bash: c: command not found
  1. Enter ^p for previous line (no effect)
  2. Enter ^p again to get the second-to-last history line, or any other character to see the last history line with the second character appended

Describe the results you received

^p seems to be unique in only being passed to the container in pairs. ^n and other ASCII characters seem to be passed as they are received.

Describe the results you expected

^p should be passed to the container immediately, where processes would process it as they do outside a container.

podman info output

host:
  arch: amd64
  buildahVersion: 1.30.0
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.7-1.2.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.7, commit: unknown'
  cpuUtilization:
    idlePercent: 99.46
    systemPercent: 0.15
    userPercent: 0.38
  cpus: 16
  databaseBackend: boltdb
  distribution:
    distribution: '"opensuse-tumbleweed"'
    version: "20230401"
  eventLogger: journald

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions