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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

alacritty_terminal: infinite loop when double-width character resized into single column terminal #7697

Open
ConradIrwin opened this issue Feb 7, 2024 · 5 comments

Comments

@ConradIrwin
Copy link
Contributor

ConradIrwin commented Feb 7, 2024

If you resize an alacritty terminal to 1 column wide while it is displaying a double-width character (in our example "馃"), then it infinite loops and this allocation will continually increase the amount of RAM used until the process is killed by the system.

The fix we've gone with is to ensure that we always render at least 2 columns: zed-industries/zed#7471, but filing this in case it's of interest to other embedders. (It does not affect alacritty itself which seems to have a minimum width of closer to 10 columns).

System

We're embedding alacritty v0.21 in Zed.

@kchibisov
Copy link
Member

alacritty sets the minimum amount of columns to 2 as well, since the alacritty_terminal supports only minimum of 1x2 sizes.

That should probably be a part of resize routine in alacritty_terminal...

@chrisduerr
Copy link
Member

Yeah single-column is just not supported. It doesn't really make sense considering a fullwidth character is two columns wide.

@chrisduerr
Copy link
Member

The fix we've gone with is to ensure that we always render at least 2 columns

Note that what Alacritty does is limiting the terminal to 2 columns, not the rendering. Alacritty works with a 1x1 window size last I checked.

@kchibisov
Copy link
Member

yeah, but we limit that in alacritty itself, not alacritty_term, we could probably limit in alacritty_term instead, so you kind of not resize to 1x1.

@chrisduerr
Copy link
Member

yeah, but we limit that in alacritty itself, not alacritty_term, we could probably limit in alacritty_term instead, so you kind of not resize to 1x1.

Yeah that's fair, we shouldn't allow resizing below our minimum size.

@kchibisov kchibisov reopened this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants