zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Can't type in the first instants of opening terminal

Open tomsib2001 opened this issue 2 years ago • 4 comments

I use Zellij and Alacritty on Ubuntu 20.04 (but I also have the same setup on a different computer with Ubuntu 22.04) and upon launching the terminal, what I type in the first seconds is not taken into account; for instance if I type emacs as soon as I see the terminal, only the letter s will actually be taken into account. I'm not sure what I should or shouldn't add to help reproduce, but I'll happily do it.

tomsib2001 avatar Aug 06 '22 18:08 tomsib2001

Hey, this is unfortunately a by-design bug. Kudos for catching it though :)

When Zellij starts up, it queries the terminal emulator for various pieces of data (eg. the pixel-to-text-cell ratio, your defined color palette, etc). The responses to these queries come over STDIN. If we let you type while this is happening, the responses will be corrupted. Since not all terminal emulators support all of these types of queries, I decided to implement this with a timeout.

It would for sure be good to indicate this to the user somehow (eg. some sort of very brief loading indication so you know you can't start typing yet), but development time is a valuable resource :) So until then, we're left with this bug. Apologies for the inconvenience!

imsnif avatar Aug 07 '22 10:08 imsnif

Thanks for the quick answer! Now I know there's a reason for it.

tomsib2001 avatar Aug 10 '22 11:08 tomsib2001

It would for sure be good to indicate this to the user somehow (eg. some sort of very brief loading indication so you know you can't start typing yet), but development time is a valuable resource :) So until then, we're left with this bug. Apologies for the inconvenience!

Wouldn't it make sense to leave this issue open or open a new one so that its apparent that there's a desired behavior change here? I only came across this because its been bugging me for a few days now and hadn't seen a fix -- not being able to type right away is really unfortunate, is there no way to potentially buffer stdin until the querying is done or any other potential solutions?

repnop avatar Aug 12 '22 17:08 repnop

Fair enough @repnop - I'm reopening this.

I can't personally think of a way to buffer STDIN, when it's the same pipe the terminal emulator sends us this info through. Seeing as this info can and does get chunked, allowing STDIN from the user might corrupt it. If you or anyone else has any ideas besides a visual indication, I'm all ears.

imsnif avatar Aug 12 '22 18:08 imsnif