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

fix(ui): draw ui properly on terminal start #323

Merged
merged 2 commits into from Apr 22, 2021
Merged

Conversation

imsnif
Copy link
Member

@imsnif imsnif commented Apr 22, 2021

This is a fix for #301 and #303

The problem was:
For some reason, if invoked as the default command in a terminal, when Zellij requests the terminal size from the OS it gets a wrong window size. Very shortly afterwards, the OS sends a SIGWINCH and then Zellij gets the correct window size.

In this scenario, we had a bug where plugins (in this case, the tab bar) would only set their "max_height" limitation (which is supposed to prevent this issue from happening) after the layout has already been arranged (and in most cases, the initial correct SIGWINCH received).

This fixes the issue by having the Fixed attribute in the layout do the same as set_max_height/set_max_width in the plugin API. This is probably the correct behaviour, even though it creates somewhat of a duplication. I left set_max_height and set_max_width because they happen at runtime, and I can imagine situations where plugins might want to change these values as a reaction to certain things that happen.

@imsnif imsnif merged commit 169e25a into main Apr 22, 2021
@h3nill h3nill deleted the fix-top-tab-bar-startup branch May 4, 2021 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant