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

'podman exec' resets the terminal size to 80x24 #3946

Closed
debarshiray opened this issue Sep 5, 2019 · 1 comment
Closed

'podman exec' resets the terminal size to 80x24 #3946

debarshiray opened this issue Sep 5, 2019 · 1 comment
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

@debarshiray
Copy link
Member

debarshiray commented Sep 5, 2019

/kind bug

Description

Somewhere between podman-1.4.4-4.fc29 and podman-1.5.1-3.fc29, podman exec started to reset the inner terminal's size to 80x24 even if the outer terminal had different dimensions.

Reverting runc doesn't help. eg., I went as far back as runc-1.0.0-57.dev.git9e5aa74.fc29.

In order to reproduce, resize the window of your terminal emulation application, and then use less(1) to render some text. You will see that less(1) either doesn't use the full extent of the terminal or uses too much, depending on whether your terminal emulation window is bigger or smaller than 80x24.

This doesn't affect terminals created by podman run.

This isn't affected:

$ podman run --env TERM=$TERM --rm -it registry.fedoraproject.org/f30/fedora-toolbox:30 /bin/bash

However, this is affected:

$ podman create --name foo registry.fedoraproject.org/f30/fedora-toolbox:30 sleep +Inf
$ podman start foo
$ podman exec --env TERM=$TERM -it foo /bin/bash

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

Reproducible at will.

Output of podman version:

Version:            1.5.1
RemoteAPI Version:  1
Go Version:         go1.11.12
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.11.12
  podman version: 1.5.1
host:
  BuildahVersion: 1.10.1
  Conmon:
    package: podman-1.5.1-3.fc29.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.0, commit: fa55639b725e7626b28dbd43de8e9546f7411226-dirty'
  Distribution:
    distribution: fedora
    version: "29"
  MemFree: 322080768
  MemTotal: 8126631936
  OCIRuntime:
    package: runc-1.0.0-93.dev.gitb9b6cc6.fc29.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc8+dev
      commit: 82f4855a8421018c9f4d74fbcf2da7f8ad1e11fa
      spec: 1.0.1-dev
  SwapFree: 4130586624
  SwapTotal: 4133482496
  arch: amd64
  cpus: 4
  eventlogger: journald
  hostname: kolache
  kernel: 5.2.7-100.fc29.x86_64
  os: linux
  rootless: true
  uptime: 2h 16m 43.25s (Approximately 0.08 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/rishi/.config/containers/storage.conf
  ContainerStore:
    number: 1
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/rishi/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 1
  RunRoot: /run/user/1000
  VolumePath: /home/rishi/.local/share/containers/storage/volumes

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

podman-1.5.1-3.fc29.x86_64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 5, 2019
@haircommander
Copy link
Collaborator

this is a dup of #3903

debarshiray pushed a commit to tagoh/toolbox that referenced this issue Sep 5, 2019
See: containers/podman#3946

COLUMNS and LINES may not be set in the user's environment. Hence the
existing mechanism for preserving environment variables don't work.

https://github.com/debarshiray/toolbox/issues/242
debarshiray pushed a commit to tagoh/toolbox that referenced this issue Sep 9, 2019
See: containers/podman#3946

COLUMNS and LINES may not be set in the user's environment. Hence the
existing mechanism for preserving environment variables don't work.

Note that for things to keep working when invoked via D-Bus from
inside a toolbox container, the terminal size needs to be queried using
the standard input stream, instead of explicitly mentioning the
controlling terminal device /dev/tty. This is because stty(1) doesn't
have the notion of a controlling terminal when invoked via D-Bus, but
flatpak-spawn(1) ensures that the standard input stream still points
to the user's interactive terminal.

https://github.com/debarshiray/toolbox/issues/242
debarshiray added a commit to containers/toolbox that referenced this issue Sep 9, 2019
When running nested, stty(1) is invoked against the inner
pseudo-terminal pair created by 'podman exec --tty' which may not have
a valid size due to: containers/podman#3946

In such cases, the COLUMNS and LINES variables set by toolbox(1) in the
outer environment should be forwarded.

This should have been part of commit 05544fb.

https://github.com/debarshiray/toolbox/issues/242
debarshiray added a commit to containers/toolbox that referenced this issue Sep 10, 2019
When running nested, stty(1) is invoked against the inner
pseudo-terminal pair created by 'podman exec --tty' which may not have
a valid size due to: containers/podman#3946

In such cases, the COLUMNS and LINES variables set by toolbox(1) in the
outer environment should be forwarded.

This should have been part of commit 05544fb.

https://github.com/debarshiray/toolbox/issues/242
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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