fix(ui): draw ui properly on terminal start #323
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asset_max_height
/set_max_width
in the plugin API. This is probably the correct behaviour, even though it creates somewhat of a duplication. I leftset_max_height
andset_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.