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 get terminal window size inside toolbox via TIOCGWINSZ ioctl #1524

Open
troiganto opened this issue Aug 9, 2024 · 1 comment
Open
Labels
1. Bug Something isn't working

Comments

@troiganto
Copy link

Describe the bug
Getting the terminal window size via TIOCGWINSZ ioctl doesn't work inside a toolbox.

Steps how to reproduce the behaviour

  1. Install the kitty terminal emulator in a user directory, e.g. ~/.local/kitty.app
  2. Open a kitty window, e.g. by executing ~/.local/kitty.app/bin/kitty
  3. Inside kitty, run infocmp -a > xterm-kitty to save terminal capabilities
  4. Create and enter a toolbox: toolbox create && toolbox enter; there should be a warning about unknown terminal type xterm-kitty
  5. Install the kitty terminal info: sudo mv xterm-kitty /usr/share/terminfo/x/ && sudo chown root:root /usr/share/terminfo/x/xterm-kitty
  6. Leave the toolbox
  7. Run this Python snippet to fetch the terminal window size via ioctl; note the output
  8. Enter the toolbox while ensuring kitty integration: toolbox run ~/.local/kitty.app/bin/kitten run-shell
  9. Run the same Python snippet again and note the output

Expected behaviour
Outside the toolbox:

number of rows: 40 number of columns: 160screen width: 1440 screen height: 760

Inside the toolbox:

number of rows: 40 number of columns: 160screen width: 1440 screen height: 760

Same output both outside and inside the toolbox.

Actual behaviour
Outside the toolbox:

number of rows: 40 number of columns: 160screen width: 1440 screen height: 760

Inside the toolbox:

number of rows: 40 number of columns: 160screen width: 32765 screen height: 0

The window size inside the toolbox is different and obviously invalid.

Output of toolbox --version (v0.0.90+)
toolbox version 0.0.99.5

Toolbx package info (rpm -q toolbox)
toolbox-0.0.99.5-11.fc40.x86_64

Output of podman version

Client:       Podman Engine
Version:      5.1.2
API Version:  5.1.2
Go Version:   go1.22.5
Built:        Wed Jul 10 02:00:00 2024
OS/Arch:      linux/amd64

Podman package info (rpm -q podman)
podman-5.1.2-1.fc40.x86_64

Info about your OS
Fedora Silverblue 40

Additional context
Output of toolbox list -i:

IMAGE ID      IMAGE NAME                                    CREATED
649e13d69576  registry.fedoraproject.org/fedora-toolbox:40  7 weeks ago

Output of kitty --version:

kitty 0.35.2 created by Kovid Goyal

I've logged onto another computer via kitten ssh and run the Python snippet there and it found the terminal window size without issue. Running pure kitten run-shell without a toolbox also doesn't block terminal window size from being reported.

Please let me know if I forgot any info, thanks in advance!

@troiganto troiganto added the 1. Bug Something isn't working label Aug 9, 2024
@troiganto
Copy link
Author

Hi, since there haven't been any reactions, I assume this issue currently lacks a clear path forward. Unfortunately, I'm not super familiar myself with the internals of toolbox, nor with the eternal hell that is TTY communication.

Does anyone have advice for me how to collect more precise information? Or maybe how to make the reproduction simpler?

I'm interested in having this problem solved so any pointers on how I can help would be welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant