toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

Paste weirdness in console

Open cajus opened this issue 1 year ago • 10 comments

Describe the bug I ran into a strange problem that occurs when pasting ascii content (larger than ~17k) into the terminal which is started by toolbox enter. It can be reproduced with vim as shown below. I'm using the Gnome Terminal.

Steps how to reproduce the behaviour

  1. Run toolbox enter (stock fedora 37 toolbox, up to date)
  2. Create output with more than 17416 bytes: python3 -c 'print("a" * 17417)'
  3. Copy that content to the clipboard by selecting it with the mouse
  4. Open "vi", enter insert mode by typing "i"
  5. Paste the content into vi

Expected behaviour Content pops up in vi.

Actual behaviour The application (vi) freezes, no further keyboard input (i.e. Ctrl + z) is possible. Needs to be killed.

Output of toolbox --version toolbox version 0.0.99.3

Toolbox package info (rpm -q toolbox) toolbox-0.0.99.3-7.fc37.x86_64

Output of podman version

Client:       Podman Engine
Version:      4.4.2
API Version:  4.4.2
Go Version:   go1.19.6
Built:        Wed Mar  1 12:22:59 2023
OS/Arch:      linux/amd64

Podman package info (rpm -q podman) podman-4.4.2-2.fc37.x86_64

Info about your OS Fedora Silverblue 37

Additional context The paste works, if you start a nested (non login) bash from the toolbox enter prompt. The paste works on the host. The paste works if you don't use toolbox enter, but toolbox run /bin/bash.

I'm completely unsure whose problem this is. As it only happens in toolbox, I tend to point here, but I can't find anything buffer related in the code/container config what could be responsible for that. On the other hand, there's a login shell vs shell bash involved. And a vim. Maybe someone has an idea...

cajus avatar Mar 10 '23 08:03 cajus

The paste works if you don't use toolbox enter, but toolbox run /bin/bash.

Are you saying that the paste works with toolbox run /bin/bash, but not with toolbox enter?

debarshiray avatar Mar 13 '23 18:03 debarshiray

I'm saying that pasting data > 17416 bytes does not work (at least with the vim example above) if the shell is a login shell. toolbox enter creates a login shell. And I'm saying that this is weird. And a bit anyoing, because I've to kill my vim sessions three times a day ;-)

cajus avatar Mar 13 '23 19:03 cajus

Okay. :)

I did a quick test on Fedora 36 Workstation with:

crun-1.8.1-1.fc36.x86_64
podman-4.4.1-3.fc36.x86_64
toolbox-0.0.99.4-1.fc36.x86_64

... and the paste works with bash -l running on the host, toolbox run bash -l and toolbox enter.

I noticed that you have toolbox-0.0.99.3-7.fc37. Could you try toolbox-0.0.99.4-1.fc37 ?

debarshiray avatar Mar 16 '23 13:03 debarshiray

I failed to replace the toolbox package here on silverblue. It doesn't want to override it. Trying to override/remove it first doesn't help with installing afterwards. Will try on a non silverblue machine later on (after trying if it is an issue there at all). Will be back...

cajus avatar Mar 16 '23 15:03 cajus

I've only a non silverblue f38 test box. It came with 0.99.4-1, but that says

$ rpm -qa toolbox podman
podman-4.4.2-2.fc38.x86_64
toolbox-0.0.99.4-1.fc38.x86_64
$ toolbox create
Error: failed to get the Podman version
$ 

cajus avatar Mar 16 '23 16:03 cajus

Tried with 0.99.4, and it's still the same here.

cajus avatar Mar 22 '23 08:03 cajus

I've only a non silverblue f38 test box. It came with 0.99.4-1, but that says

$ rpm -qa toolbox podman
podman-4.4.2-2.fc38.x86_64
toolbox-0.0.99.4-1.fc38.x86_64
$ toolbox create
Error: failed to get the Podman version
$ 

Is toolbox create still failing like that for you? If so, could you run toolbox -v create and toolbox -vv create for some extra logs?

debarshiray avatar Mar 29 '23 11:03 debarshiray

Tried with 0.99.4, and it's still the same here.

What was the host operating system?

debarshiray avatar Mar 29 '23 11:03 debarshiray

Is this still a problem?

debarshiray avatar Sep 28 '23 07:09 debarshiray

Yes, it is.

$ rpm -qa toolbox podman
podman-4.6.2-3.fc38.x86_64
toolbox-0.0.99.4-1.fc38.x86_64

Host operating system is fedora silverblue 38. Toolbox is f38.

cajus avatar Sep 28 '23 07:09 cajus